diff options
author | Chirayu Chiripal <chirayu.chiripal@gmail.com> | 2015-02-16 23:15:01 +0300 |
---|---|---|
committer | Chirayu Chiripal <chirayu.chiripal@gmail.com> | 2015-02-16 23:16:19 +0300 |
commit | 8de1f89922bb4447d9bb156096c6d826113749cc (patch) | |
tree | d27858ac6f4de8a3cbc461a40c1ef74b85fb3cd1 /js/ajax.js | |
parent | 3a34d0e2e8c5b4914ce3f8be2d7612b0c24d8214 (diff) |
bugfix 4770: Multiple delete on table browse ignoring foreign key checkbox
Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>
Diffstat (limited to 'js/ajax.js')
-rw-r--r-- | js/ajax.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/ajax.js b/js/ajax.js index 110d7e6796..f3f771d770 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -604,6 +604,23 @@ AJAX.registerOnload('functions.js', function () { $(this).data('onsubmit', this.onsubmit).attr('onsubmit', ''); } }); + + /** + * Workaround for passing submit button name,value on ajax form submit + * by appending hidden element with submit button name and value. + */ + $("#page_content").on('click', 'form input[type=submit]', function() { + var buttonName = $(this).attr('name'); + if (typeof buttonName === 'undefined') { + return; + } + $(this).closest('form').append($('<input/>', { + 'type' : 'hidden', + 'name' : buttonName, + 'value': $(this).val() + })); + }); + /** * Attach event listener to events when user modify visible * Input or Textarea fields to make changes in forms |