error while post from using json

6 years ago
Hello All,


TypeError: a.validator.methods[b] is undefined

...var c={method:b,parameters:f[b]};try{if(d=a.validator.methods[b].call(this,k,h,c...

I am getting some issue when i want to post form using Json. Ex. Change password module.

i want to change passowrd using jquery to avoid page round trip for user.

My code is below.  

Please help me. what i am missing here...

@model ChangePasswordModel
@using Nop.Web.Models.Customer;
    Layout = "";

@using (Html.BeginForm(null, null, FormMethod.Post, new {id="ChangePassword" }))
        <div class="changepassworddiv">
            <div class="message-error">
            @if (!String.IsNullOrEmpty(Model.Result))
                <div class="result">

            <div class="form-fieldsChangePassword">
                @*<div class="inputs">
                        @Html.LabelFor(model => model.OldPassword, new { }, ":")
                        @Html.EditorFor(model => model.OldPassword)
                        @Html.ValidationMessageFor(model => model.OldPassword)
                <div class="inputs">
                    @Html.LabelFor(model => model.NewPassword, new { }, ":")
                    @Html.EditorFor(model => model.NewPassword)
                    @Html.ValidationMessageFor(model => model.NewPassword)
                <div class="inputs">
                    @Html.LabelFor(model => model.ConfirmNewPassword, new { }, ":")
                    @Html.EditorFor(model => model.ConfirmNewPassword)
                    @Html.ValidationMessageFor(model => model.ConfirmNewPassword)

            <div class="buttons">
                <input type="button" class="button-1 change-password-button" value="Change Password" id="btnChangePassword" />
                <script type="text/javascript">
                    $(document).ready(function () {
                        $('#btnChangePassword').click(function () {

Thanks in Advance...
6 years ago
Both  client side validation and server side validation are enabled by default for change password, round tip should not happen if browse javascript is enabled.
Anyway, your code should work, can you simple try $.validator in browser debugger tool to make sure that validate function is loaded.