X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=web%2Fiwf%2Fiwfajax.js;h=d6d58061d16e384fb560652c0d4a83a156b9e847;hb=1ccfac96de91ec6b87bf4cd74667d4b8159f5125;hp=e5c41b47dfaf7ef5a11f3ef8605c993f3a527ae4;hpb=fc5c73fcd97f9c6573e7407f688f52ce56ad98bc;p=webpac2 diff --git a/web/iwf/iwfajax.js b/web/iwf/iwfajax.js index e5c41b4..d6d5806 100644 --- a/web/iwf/iwfajax.js +++ b/web/iwf/iwfajax.js @@ -275,6 +275,9 @@ function _iwfGetFormData(form, url, ctl){ case 'input': switch(iwfAttribute(el, 'type')){ case 'checkbox': + if (iwfAttribute(el, 'checked')){ + val = 'on'; + } case 'radio': if (iwfAttribute(el, 'checked')){ val = iwfAttribute(el, 'value'); @@ -311,11 +314,11 @@ function _iwfGetFormData(form, url, ctl){ } break; case 'textarea': - val = iwfAttribute(el, 'innerText'); + val = iwfAttribute(el, 'innerText') || el.value; break; case 'button': if (el == ctl){ - val = iwfAttribute(el, 'innerText'); + val = iwfAttribute(el, 'innerText') || el.value; } break; case 'select': @@ -458,11 +461,13 @@ function _iwfInsertHtml(html, parentNodeId){ // our html to inject contains a form node. // bubble up the chain until we find a
node, or we have no parents var elParent = el; - while (elParent && elParent.tagName.toLowerCase() != 'form'){ + // I have doubts about adding elParent.tagName here + // but I don't have better idea. -dpavlin + while (elParent && elParent.tagName && elParent.tagName.toLowerCase() != 'form'){ elParent = iwfGetParent(elParent); } - if (elParent && elParent.tagName.toLowerCase() == 'form'){ + if (elParent && elParent.tagName && elParent.tagName.toLowerCase() == 'form'){ iwfLog('IWF Ajax Error: Attempting to inject html which contains a node into a target element which is itself a node, or is already contained by a node.\nThis is bad html, and will not work appropriately on some major browsers.', true); } } @@ -520,7 +525,7 @@ function _iwfInsertHtml(html, parentNodeId){ iwfAppendChild('body', elScript); } catch(e){ -iwfLog("IE Hack for injecting script tag...", true); +//iwfLog("IE Hack for injecting script tag...", true); //! IE hack // IE needs a visible tag within a non-script element to have scripting apply... Don't ask me why, ask the IE team why. // My guess is the visible element causes the page to at least partially re-render, which in turn kicks off any script parsing @@ -694,7 +699,7 @@ function _iwfOnRequestEnd(){ } } else { // use default busy implementation... - window.status = 'Remaining: ' + _iwfRequestsPending; + window.status = 'Remaining: ' + _iwfPendingRequests; } } else { // they didn't define an end function,