jQuery Validation Plugin + equalTo Not Working

后端 未结 5 1339
野的像风
野的像风 2020-11-30 13:36

Here is what I am currently using to attempt to validate a form. When I press submit with no values entered into the form, I get the error messages for each of the inputs a

5条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 14:31

    @Tom try

            newpassword1: { required: true }, 
            newpassword2: { required: true,equalTo: "#newpassword1"},
            newemail1: { required: true, email: true },
            newemail2: { required: true,email: true ,equalTo: "#newemail1" }
    

    or use the latest version of validation plugin

    Now rules have added with password being required set to true and the second condition is for password_again set to required true and it has to “equalTo” the input field with id of password. With these conditions set, we are able to achieve what we are wanting. Do not forget to check the demo of the post to see how it works. For more documentation and resource on this plugin visit jQuery Validation Plugin

提交回复
热议问题