In real-world development, it is impossible to verify the Easyui verification option when the AJAX submission form is encountered, which is very disturbing to the actual user experience. Of course, this is also a matter for granted.
Workaround: Use the Ajax Beforesend event in jquery (which needs to be used in conjunction with the Easyui framework), for example:
submitform:function (Formid,url) { var formData = $ (formId). form (' getValues ');//Get form data $.ajax ({ type: ' POST ', url:url, &NBS P data:{formdata:formdata}, DataType: ' JSON ', Beforesen D:function () { return $ (formId). form (' validate ');//Verify form submission &N Bsp }, success:function (result) { &NBSP ; if (result.success) { $.messager.alert (' Hint ', result.message); }else{ &NBSP ; $.messager.alert (' Errors ', result.message, ' error '); }& nbsp &NBSp } }); }
Ajax submission forms cannot validate Easyui validation options (such as required, etc.)