wahlhelfer/statistics/js/accounts.js

60 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

2014-05-15 16:49:45 +00:00
// JavaScript Document
//login page javascript
$(document).ready(function() {
// Change password form validation
$("#changePassForm").validate({
rules: {
oldPassword: {
required: true,
equalTo: "#oldHidPass"
},
newPassword: {
required: true,
minlength: 6
},
confirmPassword: {
required: true,
equalTo: "#newPassword"
}
},
messages: {
oldPassword: {
required: "Enter old password.",
equalTo: "Wrong old password."
},
newPassword: {
required: "Enter new password.",
minlength: "Enter at least 6 characters."
},
confirmPassword: {
required: "Confirm new password.",
equalTo: "Enter same password as above."
}
}
});
// Change Email form validation
$("#changeEmailForm").validate({
rules: {
username: {
required: true,
equalTo: "#usernameHidd"
},
newEmail: {
required: true,
email: true
}
},
messages: {
username: {
required: "Enter old email.",
equalTo: "Old email did not match in the system."
},
newEmail: {
required: "Enter new email address.",
email: "Invalid email address."
}
}
});
});