diff options
-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(); + } }); - }); + } } |