mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
validate current password, set highlight and unhiglight functions
remove old js code
This commit is contained in:
parent
f1cfa81c39
commit
7bc2b140b9
|
@ -34,35 +34,7 @@ class SeedDMS_View_EditUserData extends SeedDMS_Bootstrap_Style {
|
||||||
function js() { /* {{{ */
|
function js() { /* {{{ */
|
||||||
header('Content-Type: application/javascript');
|
header('Content-Type: application/javascript');
|
||||||
?>
|
?>
|
||||||
function checkForm()
|
|
||||||
{
|
|
||||||
msg = new Array();
|
|
||||||
if ($("#pwd").val() != $("#pwdconf").val()) msg.push("<?php printMLText("js_pwd_not_conf");?>");
|
|
||||||
if ($("#fullname").val() == "") msg.push("<?php printMLText("js_no_name");?>");
|
|
||||||
if ($("#email").val() == "") msg.push("<?php printMLText("js_no_email");?>");
|
|
||||||
// if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
|
||||||
if (msg != "") {
|
|
||||||
noty({
|
|
||||||
text: msg.join('<br />'),
|
|
||||||
type: 'error',
|
|
||||||
dismissQueue: true,
|
|
||||||
layout: 'topRight',
|
|
||||||
theme: 'defaultTheme',
|
|
||||||
_timeout: 1500,
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
/*
|
|
||||||
$('body').on('submit', '#form', function(ev){
|
|
||||||
if(checkForm()) return;
|
|
||||||
ev.preventDefault();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
$("#form").validate({
|
$("#form").validate({
|
||||||
invalidHandler: function(e, validator) {
|
invalidHandler: function(e, validator) {
|
||||||
noty({
|
noty({
|
||||||
|
@ -74,7 +46,16 @@ $(document).ready( function() {
|
||||||
timeout: 1500,
|
timeout: 1500,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
highlight: function(e, errorClass, validClass) {
|
||||||
|
$(e).parent().parent().removeClass(validClass).addClass(errorClass);
|
||||||
|
},
|
||||||
|
unhighlight: function(e, errorClass, validClass) {
|
||||||
|
$(e).parent().parent().removeClass(errorClass).addClass(validClass);
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
currentpwd: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
fullname: {
|
fullname: {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
@ -87,6 +68,7 @@ $(document).ready( function() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
|
currentpwd: "<?php printMLText("js_no_currentpwd");?>",
|
||||||
fullname: "<?php printMLText("js_no_name");?>",
|
fullname: "<?php printMLText("js_no_name");?>",
|
||||||
email: {
|
email: {
|
||||||
required: "<?php printMLText("js_no_email");?>",
|
required: "<?php printMLText("js_no_email");?>",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user