21,886
社区成员
发帖
与我相关
我的任务
分享
<form method="post" target="saveframe">
<table width="100%" border="0">
<tr>
<th width="30%" align="right">登录名</th>
<td width="70%"> {if getd('id')}
{$data['login_name']}
{else}
<input type="text" name="login_name" check='require'/>
{/if} </td>
</tr>
<tr>
<th align="right">密码</th>
<td> {if getd('id')} <a onclick="javascript:$(this).hide();$(this).next().show();">重置密码</a>
<input style="display:none" type="text" name="password"/>
{else}
<input type="text" name="password" check='require' value="123456" />
{/if} </td>
</tr>
<tr>
<th align="right">真实姓名</th>
<td><input type="text" name="real_name" value="{$data['real_name']}" check='require'/></td>
</tr>
<tr>
<th align="right">手机</th>
<td><input type="text" name="mobile" value="{$data['mobile']}" check='mobile'/></td>
</tr>
<tr>
<th align="right">email</th>
<td><input type="text" name="email" value="{$data['email']}" check='email'/></td>
</tr>
<tr>
<th align="right">工号</th>
<td><input type="text" name="gonghao" value="{$data['gonghao']}" check='require'/></td>
</tr>
<tr>
<th align="right">部门</th>
<td>{html::select($departments,$data['department'],'name=department;str=require')} </td>
</tr>
<tr>
<td style="text-align:center"> </td>
<td>{html::button()}</td>
</tr>
</table>
</form>
$('form').submit(function(){
if(!isFormChanged(null,null)){
//alert('表单内容为空或未改变!');
return false;
}else{
if(c.length == 0) return true;
if(cansub == 0){
c.each(function(){
validate.check_lagel(this,checks);
})
}
if(validate.checking > 0){
cansub = 1;
setTimeout(function(){
$('form :submit').click();
},20);
return false;
}else{
cansub = 0;
var cansubmit = true;
for(var i in validate.error){
if (validate.error[i]){
cansubmit = false;
break;
}
}
return cansubmit;
}
}
})
<script>
$(function() {
var st = {};
$('[type=text]').bind('input propertychange', function() {
st[this.name] = this.value;
});
$('form').submit(function(){
$.post(this.action, st, function(d) { alert(d) });
return false;
});
});
</script>
<?php
if($_POST) {
print_r($_POST);
exit;
}
?>
<script src=scripts/jquery-1.8.3.min.js></script>
<script>
$(function() {
var st = {};
$('[type=text]').bind('propertychange', function() {
st[this.name] = this.value;
});
$('form').submit(function(){
$.post(this.action, st, function(d) { alert(d) });
return false;
});
});
</script>
<form action='test.php'>
<input type=text name=a>
<input type=text name=b>
<input type=text name=c>
<input type=submit value=ok>
</form>
var st = {};
$('[type=text]').propertychange(function() {
st[this.name] = this.value;
});
$('form').submit(function(){
$.post(this.action), st);
return false;
});