diff options
author | Chirayu Chiripal <chirayu.chiripal@gmail.com> | 2014-05-16 18:10:13 +0400 |
---|---|---|
committer | Chirayu Chiripal <chirayu.chiripal@gmail.com> | 2014-05-21 20:12:21 +0400 |
commit | 85390a71693d33c2efabf1857b4f2120c104b735 (patch) | |
tree | 0d1f8672261bbe57d8a6dbc0eabb5ab459c273c8 /js/tbl_change.js | |
parent | 635534e068a209af1420510a8ed99edb81930f4b (diff) |
rfe-982: Support for editing binary fields in hexadecimal
Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>
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 a05d93369d..b18a0ced3f 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -173,6 +173,10 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) // Unchecks the Ignore checkbox for the current row $("input[name='insert_ignore_" + multi_edit + "']").prop('checked', false); var $this_input = $("input[name='fields[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 + "][" + urlField + "]']"); + } // Does this field come from datepicker? if ($this_input.data('comes_from') == 'datepicker') { @@ -228,9 +232,17 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType) return false; } } + // validate binary & blob types + if (theType.indexOf('blob') > -1 || theType.indexOf('binary') > -1) { + $this_input.removeClass("invalid_value"); + if ($this_input.val().match(/^[a-f0-9]*$/i) === null) { + $this_input.addClass("invalid_value"); + return false; + } + } } } - /* End of datetime validation*/ + /* End of fields validation*/ /** |