首页 > Web开发 > 详细

提交form表单---修改密码 ajax、jQuery

时间:2017-07-17 14:04:11      阅读:362      评论:0      收藏:0      [点我收藏+]
<form id ="password" method="post">
  <table >
	<tr>
	  <td>原密码:</td>
	  <td><input  type="password" class="easyui-validatebox" required="required" name="oldPassw"/></td>  
	</tr>
	<tr>
	  <td>新密码:</td>
	  <td><input type="password" class="easyui-validatebox" required="required" name="newPassw1"/></td>
	</tr>
	<tr>
	  <td>确认密码:</td>
	  <td><input type="password" class="easyui-validatebox" required="required" name="newPassw2"/></td>
	</tr>
	<tr>
	  <td colspan="2" ><input type="reset" value="重置" style="margin-left: 50px" />
	  <input id="sub" type="button" value="提交" style="margin-left: 20px"></td>
	</tr>
  </table>
</form>	

 jquery:

$(function() {
  $("#sub").click(function(){ $("#password").form("submit",{ url:"xiuGaiPasswServlet", onSubmit: function(){ var s = $("#passsword").form("validate"); if(s) { return true; } else { $.messager.alert("提示","信息填写不完整","info"); return false; } },      success:function(data){ var data1 = eval("("+data+")"); if(data1.success){ $.messager.alert("提示","修改密码成功","info"); $("#xiugaimima").window("close"); } else { $.messager.alert("提示","修改失败","info"); } if(data1.success1){ $.messager.alert("提示","两次密码不一致","info"); } if(data1.success2){ $.messager.alert("提示","原始密码错误","info"); }   } }); });
});

  

easyui-validatebox:验证框

 

提交form表单---修改密码 ajax、jQuery

原文:http://www.cnblogs.com/gonghuixin/p/7193896.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!