DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> jQuery入門知識 >> JQuery特效代碼 >> Jquery插件easyUi表單驗證提交(示例代碼)
Jquery插件easyUi表單驗證提交(示例代碼)
編輯:JQuery特效代碼     
. 代碼如下:
<form id="myForm" method="post">
  <table align="center" style="width:400px;height:auto;margin-top: 20px"> 
         <tr>                             
             <td align="right">命令:</td>   
             <td><input id="cmd" name="cmd" style="width: 200px;" class="easyui-validatebox" required="true" validType="length[5,12]" missingMessage="不能為空"/></td>
         </tr>
         <tr>             
             <td align="right">描述:</td>
         <td><input id="depict" name="depict" style="width: 200px;" class="easyui-validatebox" required="true" validType="length[5,12]" missingMessage="不能為空"/></td>
         </tr>
         <tr>              
             <td align="right">類型:</td>              
             <td><input id="type" style="width: 200px" class="easyui-validatebox"
     url="data/editHealthCheckCombobox_data.json" valueField="id"
     textField="text" /></td>
         </tr>
         <tr>
             <td align="right">分數:</td>              
             <td><input id="score" name="score" style="width: 200px" valueField="number"/></td>
         </tr>
         <tr>
             <td align="right">使用狀況:</td>              
             <td><input id="isUse" style="width: 200px" class="easyui-validatebox"/></td>
         </tr>
         <tr>
             <td align="center" colspan="2">
              <input type="submit"  value="提交"/>
     <input type="reset" value="重置"/>
             </td>              
         </tr>
  </table>
 </form>

. 代碼如下:
//表單提交
 $('#myForm').form({
     url:'/ProcessServlet',
     onSubmit:function(){
         return $(this).form('validate');
     },
     success:function(data){
         alert(data);
     }
 }); 
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved