r8899@llin: dpavlin | 2005-11-16 16:32:37 +0100
[webpac2] / web / iwf / iwfajax.js
index e5c41b4..d68e5c8 100644 (file)
@@ -276,8 +276,8 @@ function _iwfGetFormData(form, url, ctl){
                                        switch(iwfAttribute(el, 'type')){\r
                                                case 'checkbox':\r
                                                case 'radio':\r
-                                                       if (iwfAttribute(el, 'checked')){\r
-                                                               val = iwfAttribute(el, 'value');\r
+                                                       if (iwfAttribute(el, 'checked') || el.checked){\r
+                                                               val = iwfAttribute(el, 'value') || el.value;\r
                                                        }\r
                                                        break;\r
                                                case 'button':\r
@@ -311,11 +311,11 @@ function _iwfGetFormData(form, url, ctl){
                                        }\r
                                        break;\r
                                case 'textarea':\r
-                                       val = iwfAttribute(el, 'innerText');\r
+                                       val = iwfAttribute(el, 'innerText') || el.value;\r
                                        break;\r
                                case 'button':\r
                                        if (el == ctl){\r
-                                               val = iwfAttribute(el, 'innerText');\r
+                                               val = iwfAttribute(el, 'innerText') || el.value;\r
                                        }\r
                                        break;\r
                                case 'select':\r
@@ -458,11 +458,13 @@ function _iwfInsertHtml(html, parentNodeId){
                        // our html to inject contains a form node.\r
                        // bubble up the chain until we find a <form> node, or we have no parents\r
                        var elParent = el;\r
-                       while (elParent && elParent.tagName.toLowerCase() != 'form'){\r
+                       // I have doubts about adding elParent.tagName here\r
+                       // but I don't have better idea. -dpavlin\r
+                       while (elParent && elParent.tagName && elParent.tagName.toLowerCase() != 'form'){\r
                                elParent = iwfGetParent(elParent);\r
                        }\r
 \r
-                       if (elParent && elParent.tagName.toLowerCase() == 'form'){\r
+                       if (elParent && elParent.tagName && elParent.tagName.toLowerCase() == 'form'){\r
                                iwfLog('IWF Ajax Error: Attempting to inject html which contains a <form> node into a target element which is itself a <form> node, or is already contained by a <form> node.\nThis is bad html, and will not work appropriately on some major browsers.', true);\r
                        }\r
                }\r
@@ -520,7 +522,7 @@ function _iwfInsertHtml(html, parentNodeId){
                                iwfAppendChild('body', elScript);\r
 \r
                        } catch(e){\r
-iwfLog("IE Hack for injecting script tag...", true);\r
+//iwfLog("IE Hack for injecting script tag...", true);\r
                                //! IE hack\r
                                // IE needs a visible tag within a non-script element to have scripting apply... Don't ask me why, ask the IE team why.\r
                                // My guess is the visible element causes the page to at least partially re-render, which in turn kicks off any script parsing\r
@@ -694,7 +696,7 @@ function _iwfOnRequestEnd(){
                                }\r
                        } else {\r
                                // use default busy implementation...\r
-                               window.status = 'Remaining: ' + _iwfRequestsPending;\r
+                               window.status = 'Remaining: ' + _iwfPendingRequests;\r
                        }\r
                } else {\r
                        // they didn't define an end function,\r