标签:style blog io ar color os sp java on
<td><input id="txtNickName5" class="tzy_ss_8" ebar="#spMailEmsg" valid-type="isMail" name="txtEmail" value="@Userdt2.Rows[0][3].ToString()" type="text" required></td>
<script type="text/javascript">
var isFlag = true;
function validReg(_this) {
if (!isInput($(_this).val(),
$(_this).attr("required"),
$(_this).attr("valid-type"),
$(_this).attr("ebar")))
isFlag = false;
}
$("input[valid-type]").blur(function () {
validReg(this);
});
function OnSubmit() {
isFlag = true;
$("input[valid-type]").each(function () {
validReg(this);
});
if (!isFlag){return ;}
$.post("/Account/UpdateUserInfo",
{
dwGender: $("input[name=sex]:checked").val(),
strUnderWrite: $("#txtUnderwrite").val(),
strCompellation: $("#txtNickName1").val(),
strQQ: $("#txtNickName4").val(),
strEmail: $("#txtNickName5").val(),
strMobilePhone: $("#txtNickName2").val(),
strSeatPhone: $("#txtNickName3").val(),
strDwellingPlace: $("#txtNickName6").val(),
strUserNote: $("#txtSignature1").val()
}, function (data) {
window.location.href = "/Account/Index";
}
)
};
//签名长度判断
function MaxLimit(_this, ml, msgbar) {
if ($(_this).val().length > ml) {
$(_this).val($(_this).val().substr(0, ml));
}
$(msgbar).text(ml - $(_this).val().length);
}
MaxLimit(‘#txtUnderwrite‘, 50, ‘#remLen‘);
</script>
var relist = {
isMobile: /^((\+?86)|(\(\+86\)))?1\d{10}$/,
isTel: /^((\+?86)|(\(\+86\)))?\d{3,4}-\d{7,8}(-\d{3,4})?$/,
isMail: /^\w+([-.]?\w+)*@\w+([-.]?\w+)*.\w+([-.]?\w+)*$/,
isNum: /^\d{5,15}$/
}
function isInput(k, isreq, type, ebar, emsg) {
var reg = relist[type];
var ret = reg.test(k);
if (!isreq && k === "") ret = true;
if (ebar) {
$(ebar).html(emsg ? emsg : $(ebar).html());
ret ? $(ebar).hide() : $(ebar).show();
}
return ret;
}
标签:style blog io ar color os sp java on
原文地址:http://www.cnblogs.com/d685600/p/4147109.html