diff options
author | Marc Delisle <marc@infomarc.info> | 2015-06-18 12:53:49 +0300 |
---|---|---|
committer | Marc Delisle <marc@infomarc.info> | 2015-06-18 12:53:49 +0300 |
commit | 7135013df935aa28593b2239ab68801fb2b06e50 (patch) | |
tree | 1b1e89eb37fd691eaeb23503470fdb909080e669 /js/tbl_change.js | |
parent | 6d8bceea8af031e429e07141d2991844cdabcb35 (diff) |
Bug #4965 Javascript error with ENUM on Insert tab
Signed-off-by: Marc Delisle <marc@infomarc.info>
Diffstat (limited to 'js/tbl_change.js')
-rw-r--r-- | js/tbl_change.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/tbl_change.js b/js/tbl_change.js index ef9e6b31a4..cedaafbcc1 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -167,6 +167,11 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) // the function drop-down that corresponds to this input field var $this_function = $("select[name='funcs[multi_edit][" + multi_edit + "][" + urlField + "]']"); + var function_selected = false; + if (typeof $this_function.val() !== 'undefined' && $this_function.val().length > 0) { + function_selected = true; + } + // check if it is textarea rather than input if ($this_input.length === 0) { $this_input = $("textarea[name='fields[multi_edit][" + multi_edit + "][" + @@ -222,7 +227,7 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) else if (theType.substring(0,7) === "varchar") { charExceptionHandling = theType.substring(8,9); } - if ($this_function.val().length > 0) { + if (function_selected) { $this_input.removeAttr('min'); $this_input.removeAttr('max'); // @todo: put back attributes if corresponding function is deselected @@ -231,7 +236,7 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) // explanation of the last condition: // if a function has been selected in the function drop-down, // do not validate the input field - if (target.name && target.name.substring(0, 6) === "fields" && $this_function.val().length === 0) { + if (target.name && target.name.substring(0, 6) === "fields" && ! function_selected) { // validate for date time if (theType == "datetime" || theType == "time" || theType == "date" || theType == "timestamp") { $this_input.rules("add", { |