From b95179c99c9af8873e231e20b89e4e7c7cc82d8e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 25 Sep 2010 09:21:13 -0400 Subject: [PATCH] Duplicated code --- js/indexes.js | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/js/indexes.js b/js/indexes.js index b97fcd2fda..a15b249150 100644 --- a/js/indexes.js +++ b/js/indexes.js @@ -5,51 +5,6 @@ */ /** - * Ensures a value submitted in a form is numeric and is in a range - * - * @param object the form - * @param string the name of the form field to check - * @param integer the minimum authorized value - * @param integer the maximum authorized value - * - * @return boolean whether a valid number has been submitted or not - */ -function checkFormElementInRange(theForm, theFieldName, message, min, max) -{ - var theField = theForm.elements[theFieldName]; - var val = parseInt(theField.value); - - if (typeof(min) == 'undefined') { - min = 0; - } - if (typeof(max) == 'undefined') { - max = Number.MAX_VALUE; - } - - // It's not a number - if (isNaN(val)) { - theField.select(); - alert(PMA_messages['strNotNumber']); - theField.focus(); - return false; - } - // It's a number but it is not between min and max - else if (val < min || val > max) { - theField.select(); - alert(message.replace('%d', val)); - theField.focus(); - return false; - } - // It's a valid number - else { - theField.value = val; - } - - return true; -} // end of the 'checkFormElementInRange()' function - - -/** * Ensures indexes names are valid according to their type and, for a primary * key, lock index name to 'PRIMARY' * -- 2.11.4.GIT