$(function() {
//加载函数
validation();
});
/**
* 画面検証処理
* @returns
*/
function validation() {
$("#userInfoModel").validate({
ignore: null,
rules:{
userFamilyName: {
required:true,
rangelength:[0,30]
},
userGivenName: {
required:true,
rangelength:[0,30]
},
loginId: {
required:true,
rangelength:[0,30]
},
passWorld: {
required:true,
rangelength:[0,30]
}
}
})
}
//カレンダ設定編集
function updateUserInfo() {
//这才是重点,在执行ajax之前检查
if (!$("#userInfoModel").valid()) {
return false;
};
//以下是废话可以不看
// loading始め
var bool = true;
$("#updateUserInfoButton").button('loading');
$("#updateUserInfoButtonLittle").button('loading');
$.ajax({
url : contextPath + '/SettingController/updateUserInfoAndWorkPlace',
type : 'POST',
contentType: "application/json; charset=utf-8",
data :JSON.stringify(getUserInfo()),
dataType : 'json',
success : function(data) {
if (data.success) {
top.showSuccessMsg(data.okMsg)
} else {
if (data.errorDom != '') {
showErrorTips4Check($("#" + data.errorDom), data.errorMsg);
bool = false;
} else {
top.showErrorMsg(data.errorMsg);
bool = false;
}
}
if (bool) {
location.reload() ;
}
},
complete : function(data) {
$("#updateUserInfoButton").button('reset');
$("#updateUserInfoButtonLittle").button('reset');
}
});
}