mvc 提交表单
$(
"#confirm"
).click(
function
() {
if
($(
"#txtPassword"
).val() !=
""
&& $(
"#txtOldPassword"
).val() !=
""
) {
var
txtPassword = $(
"#txtPassword"
).val();
var
txtConfirmPassword = $(
"#txtConfirmPassword"
).val();
if
($(
"#txtPassword"
).val() != $(
"#txtConfirmPassword"
).val()) {
alert(
"您两次输入的密码不一致,请重新输入!"
);
return
false
;
}
else
{
$(
"#personalForm"
).submitForm({
url:
"/Account/ChangePassword"
,
callback:
function
(data) {
alert(data.Content);
location.href =
"/Account/mydata"
;
},
before:
function
() {
}
}).submit();
}
}
else
{
alert(
"新密码不能为空!"
);
return
false
;
}
});
离开焦点后js验证邮箱
$(
"#email"
).bind(
"blur"
,
function
() {
var
bool = checkRegexp($(
"#email"
), /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}/,
"
邮箱格式不对
"
);
if
(bool) {
$.
get
(
"/register.ashx"
, { email: $(
"#email"
).val(), status: 1 },
function
(data) {
if
(data ==
"
已注册
"
) {
$(
"#email"
).addClass(
"ui-state-error"
);
updateTips(
"
邮箱已经注册
"
);
return
false
;
}
else
{
$(
"#email"
).removeClass(
"ui-state-error"
);
updateTips(
""
);
$(
".validateTips"
).removeClass(
"ui-state-highlight"
);
}
});
}
});
一个人的牛逼不如一群人的傻逼