开发者

Form not getting submitted from jQuery Validation Plugin's submitHandler

开发者 https://www.devze.com 2023-01-28 03:51 出处:网络
submitHandler: function (form) { form.submit();//jQuery(form).submit(); window.close(); } I am using the above submitHandler in validating my form through jQuery validation plugin, but the form is n
submitHandler: function (form)
{
    form.submit();   //         jQuery(form).submit();
    window.close();
}

I am using the above submitHandler in validating my form through jQuery validation plugin, but the form is not getting submitted. But, if I use the commented line instead, then the form is submitted but browser shows the 开发者_运维知识库following dialog and starts to become unresponsive, although on terminating the script by clicking "yes", the form data had been saved and window does not close.

"Stop running this script?"
"A script on this page is causing your web browser to run slowly.
 If it continues to run, your computer might become unresponsive."

          "Yes"    "No"


The commented line is an example of the too much recursion problem explained in the jQuery validation docs.

Why the usual form.submit() does not work in your case is a bit difficult to tell without more example code. It's possible that calling window.close() aborts the form submission?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号