Java web validform表单 用户实时验证 10
Js代码如下$(function(){alert($("#account").val());vardemo=$("#addform").Validform({tiptyp...
Js 代码如下
$(function() {
alert($("#account").val());
var demo = $("#addform").Validform({
tiptype : 3,
label : ".label",
showAllError : false,
datatype : {
"account" : /^[a-zA-Z][a-zA-Z0-9]{2,11}$/,
"password" : /^[a-zA-Z0-9]{5,17}$/
},
postonce : true,
ajaxPost : false
});
demo.tipmsg.w["account"] = "请输入3到12位以字母开头的字母或者数字组合!";
demo.tipmsg.w["password"] = "请输入6到18位字母数字组合!";
demo.addRule([ {
ele : "#account",
datatype : "account",
ajaxurl : "manageAction!checkAccount.action?account=1"
}, {
ele : "#password",
datatype : "password"
}, {
ele : "#password2",
datatype : "password",
recheck : "manage.passWord"
} ]);
});
HTML 代码如下:
<form class="registerform" action="manageAction!save.action"
method="post" id="addform">
<table>
<tr>
<td><label class="label"><span class="need">*</span>
用户账号:</label>
</td>
<td><input type="text" value="" id="account"
name="manage.account" class="inputxt" />
</td>
</tr>
<tr>
<td><label class="label"><span class="need">*</span>
用户密码:</label>
</td>
<td><input type="password" value="" id="password"
name="manage.passWord" class="inputxt" id="password" />
</td>
</tr>
<tr>
<td><label class="label"><span class="need">*</span>
确认密码:</label>
</td>
<td><input type="password" value="" id="password2"
name="passWord2" class="inputxt" />
</td>
</tr>
。。。。。。。省略部分
我想提问的是如何把ID为account的input标签的值通过validform ajaxurl 的方式传入服务器
ele : "#account",
datatype : "account",
ajaxurl : "manageAction!checkAccount.action?account=1"
}, {
就这块 展开
$(function() {
alert($("#account").val());
var demo = $("#addform").Validform({
tiptype : 3,
label : ".label",
showAllError : false,
datatype : {
"account" : /^[a-zA-Z][a-zA-Z0-9]{2,11}$/,
"password" : /^[a-zA-Z0-9]{5,17}$/
},
postonce : true,
ajaxPost : false
});
demo.tipmsg.w["account"] = "请输入3到12位以字母开头的字母或者数字组合!";
demo.tipmsg.w["password"] = "请输入6到18位字母数字组合!";
demo.addRule([ {
ele : "#account",
datatype : "account",
ajaxurl : "manageAction!checkAccount.action?account=1"
}, {
ele : "#password",
datatype : "password"
}, {
ele : "#password2",
datatype : "password",
recheck : "manage.passWord"
} ]);
});
HTML 代码如下:
<form class="registerform" action="manageAction!save.action"
method="post" id="addform">
<table>
<tr>
<td><label class="label"><span class="need">*</span>
用户账号:</label>
</td>
<td><input type="text" value="" id="account"
name="manage.account" class="inputxt" />
</td>
</tr>
<tr>
<td><label class="label"><span class="need">*</span>
用户密码:</label>
</td>
<td><input type="password" value="" id="password"
name="manage.passWord" class="inputxt" id="password" />
</td>
</tr>
<tr>
<td><label class="label"><span class="need">*</span>
确认密码:</label>
</td>
<td><input type="password" value="" id="password2"
name="passWord2" class="inputxt" />
</td>
</tr>
。。。。。。。省略部分
我想提问的是如何把ID为account的input标签的值通过validform ajaxurl 的方式传入服务器
ele : "#account",
datatype : "account",
ajaxurl : "manageAction!checkAccount.action?account=1"
}, {
就这块 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询