<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<title>EasyUI框架</title>
<%@ include file="/WEB-INF/jsp/public/common.jspf" %>
<script type="text/javascript">
$(function(){
/* $('#easyui_regForm').click(function(){
if(${"#easyui_regForm"}.form('validate')){
$.ajax({
url:'${pageContext.request.contextPath}/student_reg.action',
data:${"#easyui_regForm"}.serialize(),
dataType:'json',
success:function(obj,status,jqXHR){
if(obj.success){
$("#easyui_regDialog").dialog('close');
}
$.message.show({
title:'提示',
msg:obj.msg
});
}
});
}else{
alert('验证失败');
}
}); */
});
$('#easyui_regForm input').bind('keyup', function(event) {/* 增加回车提交功能 */
if (event.keyCode == '13') {
formSubmit();
}
});
function formSubmit(){
$('#easyui_regForm').form('submit',{
url : '${pageContext.request.contextPath}/student_reg.action',
success : function(data) {
var obj = jQuery.parseJSON(data);
if (obj.success) {
$('#easyui_regDialog').dialog('close');
}
$.messager.show({
title : '提示',
msg : obj.msg
});
}
});
}
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',split:true" style="height:100px;">aa</div>
<!-- <div data-options="region:'south',split:true" style="height:100px;">bb</div>-->
<div data-options="region:'east',title:'East',split:true" style="width:200px;">cc</div>
<div data-options="region:'west',title:'West',split:true" style="width:200px;">dd</div>
<div data-options="region:'center',title:'center title'" style="padding:5px;background:#eee;">kk</div>
<div class="easyui-dialog" data-options="title:'登陆', modal:true,
closable:false,
toolbar:[{
text:'Edit',
iconCls:'icon-edit',
handler:function(){alert('edit')}
},{
text:'Help',
iconCls:'icon-help',
handler:function(){alert('help')}
}],
buttons:[{
text:'登陆',
handler:function(){alert('登陆')}
},{
text:'注册',
handler:function(){
$('#easyui_regForm input').val('');
$('#easyui_regDialog').dialog('open');
}
}]" >
<table>
<tr>
<td>登陆名称:</td>
<td><input type="text" name="name"/></td>
</tr>
<tr>
<td>登陆密码:</td>
<td><input type="password" name="password"/></td>
</tr>
</table>
</div>
<div id="easyui_regDialog" class="easyui-dialog" data-options="title:'注册', modal:true,
closable:true,
closed:true,
buttons:[{
text:'注册',
handler:function(){
formSubmit();
}
},{
text:'取消',
handler:function(){alert('注册')}
}]" >
<form id="easyui_regForm" method="post">
<table>
<tr>
<td>登陆名称:</td>
<td><input type="text" name="name" class="easyui-validatebox" data-options="required:true,missingMessage:'用户名称不能为空'"/></td>
</tr>
<tr>
<td>登陆密码:</td>
<td><input id="reg_pwd" type="password" name="password" class="easyui-validatebox" data-options="required:true,missingMessage:'用户密码不能为空'"/></td>
</tr>
<tr>
<td>确定密码:</td>
<td><input type="password" name="repassword" class="easyui-validatebox" data-options="required:true,missingMessage:'确认密码不能为空',validType:'equals[\'#reg_pwd\']'" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>