It took dwz Ajax a day to get used, @ using (HTML. beginform ("edit", "xuenianxueqi", forpolichod. post, new {onsubmit = "Return validatecallback (this, dialogajaxdone)"}), return cannot be small, otherwise Ajax functions cannot be stimulated
Submit and onsubmit
Order of occurrence: onsubmit-> submit
1. Block Form ticket submission:
<SCRIPT>
Function submitfun ()
{
// Logical judgment
Return true; // allow form submission
// Logical judgment
Return false; // form submission not allowed
}
</SCRIPT>
<Form onsubmit = "Reture submitfun ();"> // note that onsubmit = "submitfun ();" cannot be written here. Otherwise, the form is always submitted.
</Form>
2. onsubmit () and submit ():
<SCRIPT>
Function fun ()
{
Alert ("form_submit ");
}
</SCRIPT>
<Form onsubmit = "Fun ()">
<Input type = "Submit" id = "AAA" value = "Submit"> <! -- Form_submit -->
<Input type = "button" id = "BBB" value = "onclick_submit" onclick = "document. Forms [0]. Submit ()">
<! --
The form is submitted, but fun () is not executed because the onsubmit event cannot be triggered in this way (in the IE environment)
Directly Using the script documetn. formname. Submit () to submit a form does not trigger the onsubmit () event of the form.
-->
<Input type = "button" id = "bb1" value = "onclick_onsubmit" onclick = "document. Forms [0]. onsubmit ()">
<! -- Triggers the fun () function -->
</Form>
Http://www.okajax.com/a/200811/1124R012008.html