From e9ee1615e75919c8963caa1af8e0fd73222b081c Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 3 Jan 2011 10:52:17 -0500 Subject: [PATCH] Function was called from just one place to fold it inside caller; also recode it with jQuery --- js/tbl_change.js | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/js/tbl_change.js b/js/tbl_change.js index 66f597620..09e826452 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -160,7 +160,12 @@ function Validator(urlField, multi_edit,theType){ var rowForm = document.forms['insertForm']; var evt = window.event || arguments.callee.caller.arguments[0]; var target = evt.target || evt.srcElement; - unNullify(urlField, multi_edit); + + // Unchecks the corresponding "NULL" control + $("input[name='fields_null[multi_edit][" + multi_edit + "][" + urlField + "]']").attr({'checked': false}); + + // Unchecks the Ignore checkbox for the current row + $("input[name='insert_ignore_" + multi_edit + "']").attr({'checked': false}); if(target.name.substring(0,6)=="fields") { @@ -225,30 +230,6 @@ function Validator(urlField, multi_edit,theType){ } /* End of datetime validation*/ -/** - * Unchecks the "NULL" control when a function has been selected or a value - * entered - * - * @param string the urlencoded field name - * @param string the multi_edit row sequence number - * - * @return boolean always true - */ -function unNullify(urlField, multi_edit) -{ - var rowForm = document.forms['insertForm']; - - if (typeof(rowForm.elements['fields_null[multi_edit][' + multi_edit + '][' + urlField + ']']) != 'undefined') { - rowForm.elements['fields_null[multi_edit][' + multi_edit + '][' + urlField + ']'].checked = false - } // end if - - if (typeof(rowForm.elements['insert_ignore_' + multi_edit]) != 'undefined') { - rowForm.elements['insert_ignore_' + multi_edit].checked = false - } // end if - - return true; -} // end of the 'unNullify()' function - /** * Ajax handlers for Change Table page *