diff options
author | Deven Bansod <devenbansod.bits@gmail.com> | 2016-09-16 16:03:28 +0300 |
---|---|---|
committer | Deven Bansod <devenbansod.bits@gmail.com> | 2016-09-16 16:03:28 +0300 |
commit | a588880750b50764217f3379af7beac9f9201769 (patch) | |
tree | 0b9071d6c5a15dd859fef989043221683461e80f /js/tbl_change.js | |
parent | ee7d7d0b45b6b20cd51b41762df7a9f8b30cb79b (diff) |
Special handling for radio fields after cloning on tbl insert page
Fix #12272
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
Diffstat (limited to 'js/tbl_change.js')
-rw-r--r-- | js/tbl_change.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/tbl_change.js b/js/tbl_change.js index eeba3b51d7..6ae5948aa6 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -553,6 +553,7 @@ AJAX.registerOnload('tbl_change.js', function () { // handle input text fields and textareas if ($this_element.is('.textfield') || $this_element.is('.char')) { // do not remove the 'value' attribute for ENUM columns + // special handling for radio fields after updating ids to unique - see below if ($this_element.closest('tr').find('span.column_type').html() != 'enum') { $this_element.val($this_element.closest('tr').find('span.default_value').html()); } @@ -675,6 +676,15 @@ AJAX.registerOnload('tbl_change.js', function () { $(this).attr('tabindex', tabindex); // update the IDs of textfields to ensure that they are unique $(this).attr('id', "field_" + tabindex + "_3"); + + // special handling for radio fields after updating ids to unique + if ($(this).closest('tr').find('span.column_type').html() === 'enum') { + if ($(this).val() === $(this).closest('tr').find('span.default_value').html()) { + $(this).prop('checked', true); + } else { + $(this).prop('checked', false); + } + } }); $('.control_at_footer') .each(function () { |