关于jquery提交表单数据的问题
需要在局部载入页面<script>functioncheck(){if(document.form.username.value==""){alert("用户名不能为空!...
需要在局部载入页面
<script>
function check() {
if (document.form.username.value == "") {
alert("用户名不能为空!");
return false;
}else if(document.form.password.value == ""){
alert("密码不能为空!");
return false;
}else {
//document.form.submit();
var p = $("#homepage").layout("panel","west");
//这里怎么在刷新局部的同时把表单数据提交给checklogin.jsp?
p.panel("open").panel("refresh","checklogin.jsp");
return true;
}
}
</script>
<div data-options="region:'west',title:'系统管理'," style="width:180px;padding:10px">
<form action="checklogin.jsp" method="POST" name="form" id="form">
<div id="log"></div>
<table>
<tr>
<td>用户名<br><input class="grayipt" type="text" name="username" value=""></td>
</tr>
<tr>
<td>密码<br><input class="grayipt" type="text" name="password" value=""></td>
</tr>
<tr>
<td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="check()">登陆</a></td>
</tr>
<tr>
<td>
<input class="btn" type="button" value="注册" onclick="register()"/>
</td>
</tr>
</table>
</form> 展开
<script>
function check() {
if (document.form.username.value == "") {
alert("用户名不能为空!");
return false;
}else if(document.form.password.value == ""){
alert("密码不能为空!");
return false;
}else {
//document.form.submit();
var p = $("#homepage").layout("panel","west");
//这里怎么在刷新局部的同时把表单数据提交给checklogin.jsp?
p.panel("open").panel("refresh","checklogin.jsp");
return true;
}
}
</script>
<div data-options="region:'west',title:'系统管理'," style="width:180px;padding:10px">
<form action="checklogin.jsp" method="POST" name="form" id="form">
<div id="log"></div>
<table>
<tr>
<td>用户名<br><input class="grayipt" type="text" name="username" value=""></td>
</tr>
<tr>
<td>密码<br><input class="grayipt" type="text" name="password" value=""></td>
</tr>
<tr>
<td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="check()">登陆</a></td>
</tr>
<tr>
<td>
<input class="btn" type="button" value="注册" onclick="register()"/>
</td>
</tr>
</table>
</form> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询