diff options
author | Marc Delisle <marc@infomarc.info> | 2015-06-15 00:09:27 +0300 |
---|---|---|
committer | Marc Delisle <marc@infomarc.info> | 2015-06-15 00:09:27 +0300 |
commit | 84fa181135a83dd0b75b44f80edc69a5311fbb0c (patch) | |
tree | 1d62c9d8269aafe6f054c2dba6caf6b798e6a1bb /js/tbl_change.js | |
parent | 7818482964e5114111de55665b6f03fb07a7a84d (diff) |
Bug #4933 INSERT validation issues with MySQL functions
Signed-off-by: Marc Delisle <marc@infomarc.info>
Diffstat (limited to 'js/tbl_change.js')
-rw-r--r-- | js/tbl_change.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/js/tbl_change.js b/js/tbl_change.js index 456cb7b831..ef9e6b31a4 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -164,6 +164,9 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) var target = evt.target || evt.srcElement; var $this_input = $("input[name='fields[multi_edit][" + multi_edit + "][" + urlField + "]']"); + // the function drop-down that corresponds to this input field + var $this_function = $("select[name='funcs[multi_edit][" + multi_edit + "][" + + urlField + "]']"); // check if it is textarea rather than input if ($this_input.length === 0) { $this_input = $("textarea[name='fields[multi_edit][" + multi_edit + "][" + @@ -219,7 +222,16 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) else if (theType.substring(0,7) === "varchar") { charExceptionHandling = theType.substring(8,9); } - if (target.name && target.name.substring(0, 6) === "fields") { + if ($this_function.val().length > 0) { + $this_input.removeAttr('min'); + $this_input.removeAttr('max'); + // @todo: put back attributes if corresponding function is deselected + } + + // 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) { // validate for date time if (theType == "datetime" || theType == "time" || theType == "date" || theType == "timestamp") { $this_input.rules("add", { |