Fix a nasty Internet Suxplorer bug which prevented XHR forms from being correctly...
authorSteven Barth <steven@midlink.org>
Sat, 8 Nov 2008 15:27:31 +0000 (15:27 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 8 Nov 2008 15:27:31 +0000 (15:27 +0000)
libs/cbi/htdocs/luci-static/resources/cbi.js

index e9a8011..abeba34 100644 (file)
@@ -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();
+                       }
                });
-       });
+       }
 }