Click here to Skip to main content
15,886,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am newbie to Knockout MVC.
I want to check password and compare password.It must be same before going to save the data in database.I am using 'jquery.validate.js' for other validation.
And i want to use this js for compare validation also.Is there any way to use 'jquery.validate.js' js for compare validation?

Below is my code :

Password: @ko.Html.Password(m => m.Password, new { id = "txtPassword", @class = "required" }).ValueUpdate(KnockoutValueUpdateKind.AfterKeyDown)

Confirm Password: @ko.Html.Password(m => m.ConfirmPassword, new { id = "txtConfirmPassword", @class = "required", validateDelegate = "password equalTo" }).ValueUpdate(KnockoutValueUpdateKind.AfterKeyDown)

and i use Script also.

<script type="text/javascript">
$("#MyForm").ajaxForm();
rules: {
password: "required",
confirmPassword : {equalTo: "#txtPassword"}
}
$("#MyForm").validate({ submitHandler: function () { @ko.ServerAction("Save", "SaveData"); } });
</script>

This code throw me an error for related token identifier in Browser's Console
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900