diff options
author | Steven Barth <steven@midlink.org> | 2008-11-08 15:27:31 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-11-08 15:27:31 +0000 |
commit | f64847e2ddd99980ce816c53d1cf5de6c4c97a27 (patch) | |
tree | dc02eb1d5d88ac1ec45c8c049b76fdc66b13bd37 | |
parent | a5cb3b04cb9bdfe10b49edcb6b1f093cdd86cdb4 (diff) |
Fix a nasty Internet Suxplorer bug which prevented XHR forms from being correctly submitted.
-rw-r--r-- | libs/cbi/htdocs/luci-static/resources/cbi.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/cbi/htdocs/luci-static/resources/cbi.js b/libs/cbi/htdocs/luci-static/resources/cbi.js index e9a801154..abeba345b 100644 --- a/libs/cbi/htdocs/luci-static/resources/cbi.js +++ b/libs/cbi/htdocs/luci-static/resources/cbi.js @@ -195,22 +195,21 @@ function cbi_filebrowser(id, url, defpath) { //Hijacks the CBI form to send via XHR (requires Prototype) function cbi_hijack_forms(layer, win, fail, load) { - layer.select('form').each(function(form) { - form.observe('submit', function(event) { + var forms = layer.getElementsByTagName('form'); + for (var i=0; i<forms.length; i++) { + $(forms[i]).observe('submit', function(event) { // Prevent the form from also submitting the regular way event.stop(); - var form = event.element(); - - if (load) { - load(); - } - // Submit via XHR - form.request({ + event.element().request({ onSuccess: win, onFailure: fail }); + + if (load) { + load(); + } }); - }); + } } |