//验证电子邮件的有效性
var myRegex = /@.*\.[a-z]{2,6}/;
mail = mail.replace(/^ | $/g,"");
mail = mail.replace(/^\.*|\.*$/g,"");
mail = mail.toLowerCase();
if ($.trim(mail) != "" && !myRegex.test(mail)){
alert ("请输入有效的E-MAIL!");
return false;
}
//排序号
var sort_number = document.getElementById('user_sort').value;
if ($.trim(sort_number)!='' && (isNaN($.trim(sort_number)) )){
alert("排序号应填写数字!");
return false;
}
$.ajax({
type: "POST",
async:false,
//dataType: "json",
url: "update.jsp",
data:$('#updateform').serialize(),
success: function (data) {
window.location.href="./titles.jsp?pageNo="+pageNo+"&userContainerCode="+userContainerCode+"&title="+title+"&name="+name+"&job="+job+"&action="+action;
},
error:function(xhr,status,statusText){
alert(xhr.responseText);
}
});
var myRegex = /@.*\.[a-z]{2,6}/;
mail = mail.replace(/^ | $/g,"");
mail = mail.replace(/^\.*|\.*$/g,"");
mail = mail.toLowerCase();
if ($.trim(mail) != "" && !myRegex.test(mail)){
alert ("请输入有效的E-MAIL!");
return false;
}
//排序号
var sort_number = document.getElementById('user_sort').value;
if ($.trim(sort_number)!='' && (isNaN($.trim(sort_number)) )){
alert("排序号应填写数字!");
return false;
}
$.ajax({
type: "POST",
async:false,
//dataType: "json",
url: "update.jsp",
data:$('#updateform').serialize(),
success: function (data) {
window.location.href="./titles.jsp?pageNo="+pageNo+"&userContainerCode="+userContainerCode+"&title="+title+"&name="+name+"&job="+job+"&action="+action;
},
error:function(xhr,status,statusText){
alert(xhr.responseText);
}
});