添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account $ ( "#loginform" ) . validate ( { submitHandler : { function formhash ( form , password ) { // Create a new element input, this will be out hashed password field. var p = document . createElement ( "input" ) ; // Add the new element to our form. form . appendChild ( p ) ; p . name = "p" ; p . type = "hidden" p . value = hex_sha512 ( password . value ) ; // Make sure the plaintext password doesn't get sent. password . value = "" ; // Finally submit the form. alert ( "Test" ) ; form . submit ( ) ; } ) ; </ script >

The form is posted (if required fields are required, so validate is working) however the code inside submitHandler is not triggered (I dont get an alert) and even though the form.submit() is within that code, the form gets parsed to the action page.

submitHandler: { function formhash()... }

This will have no effect since you cannot make function calls to an object. You need to pass submitHandler the function itself:

submitHandler: function(form) { ... }

Please refer to the docs here: http://jqueryvalidation.org/validate/

Check out this jsFiddle here: http://jsfiddle.net/c3Jre/

I'm sorry for the lack of activity on this issue. Instead of leaving it open any longer, I decided to close old issues without trying to address them, to longer give the false impression that it will get addressed eventually, especially after several years with no activity. It doesn't mean I'm abandoning the project, just that I'm unable to work through 200+ open issues with the little time I can afford to spend on this project.

To the reporter (or anyone else interested in this issue): If you're still affected by the same issue, please consider opening a new issue, with a testpage that demonstrates the issue with a current version of the plugin. Even better, make an attempt to fix the issue yourself, and improve the project by sending a pull request. This may seem daunting at first, but you'll likely learn some useful skills that you can apply elsewhere as well. And you can help keep this project alive. We've documented how to do these things, too. A patch is worth a thousand issues!