Text prompt
<Script src = ".../../scripts/boot. js" type = "text/javascript"> </script>
Text prompt
<Script type = "text/javascript">
Mini. parse ();
Function submitForm (){
Var form = new mini. Form ("# form1 ");
Form. validate ();
If (form. isValid () = false) return;
// Submit data
Var data = form. getData ();
Var json = mini. encode (data );
$. Ajax ({
Url: "../data/FormService. jsp? Method = SaveData ",
Type: "post ",
Data: {submitData: json },
Success: function (text ){
Alert ("submitted successfully, returned result:" + text );
}
});
}
//////////////////////////////////////// //
Function updateError (e ){
Var id = e. sender. name + "_ error ";
Var el = document. getElementById (id );
If (el ){
El. innerHTML = e. errorText;
}
}
Function onUserNameValidation (e ){
UpdateError (e );
}
Function onPwdValidation (e ){
UpdateError (e );
}
</Script>
Description
Set the Form Control "errorMode = none". When verification fails, the control will not display any error messages.
In the onvalidation event processing function, call the updateError method to display the error messages of different controls in a DOM element.