easyui validatebox提交验证的相关

看教学视频中 required='true'  直接可以验证 阻止提交 但是实际在1.4.3版本easyui中我使用无效 度娘也找了半天

最后找到了一个例子

<div id="index-regDialog" class="easyui-dialog" data-options="title:'注册',modal:true,closed:true,
	  		buttons:[{
	  			text:'注册',
	  			iconCls:'icon-edit',
	  			handler:function(){	  							                    $('#index-regForm').submit();
	  					}
	  					}]" >
<form id="index-regForm" method="post" data-options="novalidate:true">	
 	<table>
 		<tr>
 		<th>登录名</th>
 <td><input class="easyui-validatebox" type="text" name="name" data-options="required:true"/></td>
 		</tr>
 		<tr>
 		<th>密码</th>
 <td><input id="pwd" type="password" name="pwd" class="easyui-textbox" data-options="required:true"/></td>
 		</tr>
 		<tr>
 		<th>重复密码</th>
<td><input name="rePwd" class="easyui-textbox" data-options="required:true,validType:'equals[\'#pwd\']'" /></td>
 		</tr>						
 	</table>
 		</form>	
 		<script type="text/javascript">
		$('#index-regForm').form({
		 url:'',
		onSubmit: function(){
		return $(this).form('enableValidation').form('validate');
		},
		success:function(data){
		alert(data);
						    }
						});
 				 </script>
 		</div>


你可能感兴趣的:(easyui validatebox提交验证的相关)