///
///
///
$(function () {
//#region utility.initSubmitForm
utility.initSubmitForm($("form"), $("#btn-submit"), function (response) {
var button = {};
button[l.OK] = function () {
// dialog.close();
// utility.closePopUp();
window.top.location.reload();
};
//dialog.info(l.Message, response.m, button);
window.location.href = location.origin;
});
//#endregion
//#region Error Message
$("#error-message").hide();
window.setTimeout(function () {
$("#error-message").show(); //Click and got error
}, 2000);
//#endregion
//#region Check Password
jQuery.validator.addMethod("passwordContent", function (value, element) {
var loginName = $("#LoginName").val();
if (loginName != null && loginName != "") {
if (value.indexOf(loginName) > -1) {
return false; //contain login name
}
}
return true;
}, $("#NewPassword, #NewPasswordSHA").attr("msgContent"));
jQuery.validator.addMethod("passwordLength", function (value, element) {
return value.length >= 6 && /\d/.test(value) && /[a-z]/i.test(value);
}, $("#NewPassword, #NewPasswordSHA").attr("msgLength"));
jQuery.validator.addMethod("passwordSame", function (value, element) {
var currentPass = $("#CurrentPassword").val();
return value != currentPass;
}, $("#NewPassword").attr("msgSame"));
$("#NewPassword").rules("add", {
passwordLength: true,
passwordContent: true,
passwordSame: true
});
$("#NewPasswordSHA").rules("add", {
passwordLength: true,
passwordContent: true,
passwordSame: false
});
//#endregion
});