YouTip LogoYouTip

Jeasyui Form Form3

# jQuery EasyUI Form - Form Validation This tutorial will show you how to validate a form. The easyui framework provides a validatebox plugin to validate a form. In this tutorial, we will create a contact form and apply the validatebox plugin to validate the form. You can then adjust this form according to your own needs. !(#) #### Create the Form (form) Let's create a simple contact form with name, email, subject, and message fields:
Form Validation
<textarea name="message" style="height:60px;"></textarea>
We add a style class named `easyui-validatebox` to the input tags, so the input tags will apply validation based on the `validType` attribute. #### Prevent Form Submission When Invalid When the user clicks the submit button of the form, if the form is invalid, we should prevent the form submission. $('#ff').form({url:'form3_proc.php',onSubmit:function(){return $(this).form('validate');},success:function(data){$.messager.alert('Info', data, 'info');}}); If the form is invalid, a prompt message will be displayed. ## Download jQuery EasyUI Example [jeasyui-form-form3.zip](#)
← Jeasyui Form Form2Jeasyui Form Form1 β†’