From b27672866683d4a1b3f0d82278804165b0d63466 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 30 Apr 2011 10:54:03 -0400 Subject: [PATCH 1/3] Undefined variable --- js/tbl_change.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/tbl_change.js b/js/tbl_change.js index 2d33884a9..a6d4be933 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -165,7 +165,7 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType){ // Unchecks the Ignore checkbox for the current row $("input[name='insert_ignore_" + multi_edit + "']").attr({'checked': false}); - $this_input = $("input[name='fields[multi_edit][" + multi_edit + "][" + urlField + "]']"); + var $this_input = $("input[name='fields[multi_edit][" + multi_edit + "][" + urlField + "]']"); // Does this field come from datepicker? if ($this_input.data('comes_from') == 'datepicker') { @@ -214,11 +214,10 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType){ } } //validate for integer type - if(theType.substring(0,3)=="int"){ - - if(isNaN(dt.value)){ - dt.className="invalid_value"; - return false; + if(theType.substring(0,3) == "int"){ + if(isNaN($this_input.val())){ + $this_input.addClass("invalid_value"); + return false; } } } From 70100c8044d719300a87ee76807bf4c19d8517f5 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 30 Apr 2011 10:57:30 -0400 Subject: [PATCH 2/3] Remove invalid_value class before validation --- js/tbl_change.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/tbl_change.js b/js/tbl_change.js index a6d4be933..896700bb6 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -215,6 +215,7 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType){ } //validate for integer type if(theType.substring(0,3) == "int"){ + $this_input.removeClass("invalid_value"); if(isNaN($this_input.val())){ $this_input.addClass("invalid_value"); return false; From fcaedaf75bf6560d2c899aafa912320c52ff4505 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 30 Apr 2011 11:05:47 -0400 Subject: [PATCH 3/3] Invalid value class did not work on input fields for pmahomme --- themes/pmahomme/css/theme_right.css.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 4d18832f6..25692d27f 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -1673,8 +1673,10 @@ table#serverconnection_trg_local { /** * Validation error message styles */ -.invalid_value -{background:#F00;} +input[type=text].invalid_value, +.invalid_value { + background:#F00; +} /** * Ajax notification styling