我的职能是,在提交表格时检查某一类的所有要素,如果某一要素无效,则防止提交。 我利用“Qu”在网页上找到所有形式,并将这一功能附属于提交时的活动。
The problem with this, is as the function checks all elements of a certain type, it will prevent forms from being submitted if there are invalid elements in another form, even though it isn t being submitted so they don t matter.
To remedy this, I ve altered my function to check all elements of a certain type to accept a parameter of a form, and then only validate elements in that form. So far so good.
然而,如果该职能与“ j”放在该页上的所有表格上,我如何能够具体说明表格的参数?
当时,《酒类法》:
jQuery("form").submit(function() {
return CheckElements();
});
我需要通过目前表格,无论是作为身份证还是物体。 类似:
jQuery("form").submit(function() {
return CheckElements(SOME WAY OF PASSING THE FORM);
});
这是可能的,如果是的话,如何做到这一点?