Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmit not working in Chrome and IE under Windows 7
    text
    copied!<p>I have a web form created using .net and in this form has a frame which has its source from another HTML page (created by courselab software). I call a javascript code whenever the user completes the page and click a submit button and exits normally or whenever the user navigates away from the page based on the javascript event "onbeforeunload".</p> <p>The code works just perfectly using </p> <p><strong>Firefox in both cases</strong> *<em>IE on Windows XP in both cases</em>*</p> <p>Still it works in <strong>CHROME</strong> if the user clicked on the submit button (this submit button generated by courselab software which calls the javascript code),</p> <p>but if the user navigates away from the web form, this code is being called using the "onbeforeunload" and the code renders correctly but the submit input is never fired.</p> <p><strong>Similary this code does not fire using IE on Windows 7.</strong></p> <p>I have also called the code "onunload" of the form, but still nothing happens.</p> <p><strong>Update</strong> IE 8 Firefox 3.6.1.3 Chrome 9.0.597.98</p> <p>the main web form has the following </p> <pre><code>&lt;div id="FOContent"&gt; &lt;iframe runat=server id="mainiframe" name="mainiframe" scrolling="no" frameborder="no" width="1000" height="920"&gt;&lt;/iframe&gt; &lt;/div&gt; </code></pre> <p>The frame content comes from this HTML page</p> <pre><code>&lt;body style="margin-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;" onload="Run(true)" onunload="Shutdown()" onbeforeunload="Shutdown()" oncontextmenu="return false"&gt; &lt;div id="boardFrame" style="position:absolute;left:0px;top:0px;width:1000;height:700"&gt; &lt;/div&gt; &lt;div id="divEmail"&gt;&lt;/div&gt; &lt;/body&gt; </code></pre> <p>And the javascript code being called for "onunload" or "onbeforeunload" is </p> <pre><code>function LMSShutdown() { if (submit_Var == false) { var sAiccData = AICC_PrepareData(); // prepare data from the CourseLab var strQuizResults strQuizResults = ""; var nPos1 = sAiccData.indexOf("Score="); nPos1 = nPos1 + 6; var ePos1 = nPos1 + 2 var score = sAiccData.substring(nPos1, ePos1); var sHTML = ""; var qTxt; qTxt = "" var qrStr = window.location.search; var spQrStr = qrStr.substring(1); var arrQrStr = new Array(); // splits each of pair var arr = spQrStr.split("&amp;"); for (var i = 0; i &lt; arr.length; i++) { // splits each of field-value pair var index = arr[i].indexOf("="); var key = arr[i].substring(0, index); var val = arr[i].substring(index + 1); var id1 var id2 if (key == "") {key = "Q"+i} qTxt = qTxt + "&amp;" + key + "=" + val; if (i == 0) { id1 = val; } else { id2 = val; } } // saves each of field-value pair in an array variable sHTML += '&lt;FORM id="formQuiz" method="POST" action="../../../StudentView/QuizProcess.aspx?submit_Var=' + 'false' + '&amp;score=' + score + qTxt + '"&gt;'; var spQrStr = g_arVars["writing"]; var arrQrStr = new Array(); // splits each of pair var arr = spQrStr.split("@@@"); for (var i = 0; i &lt; arr.length; i++) { // splits each of field-value pair var index = arr[i].lastIndexOf(":"); var key = arr[i].substring(0, index); var val = arr[i].substring(index + 1); if (key != "") {qTxt = qTxt + "&amp;" + key + "=" + val; sHTML += '&lt;INPUT TYPE="hidden" NAME="' + key + '" VALUE=\'' + val + '\'&gt;'; } } sHTML += '&lt;br&gt;&lt;input name="btnSubmit" id="btnSubmit" type="button"&gt;&lt;br&gt;'; sHTML += '&lt;/FORM&gt;'; document.getElementById("divEmail").innerHTML = sHTML; document.getElementById("formQuiz").submit(); submit_Var = true; } } </code></pre> <p>The QuizProcess.aspx page has not much in HTML, but it has vb .net code to store data to database</p> <p><strong>The issue is that the function LMSShutdown is being called in all browsers on different platforms, but the form QuizProcess is not being submitted only in (chrome on Windows XP or 7 ) and in (IE 8 when using Windows 7) strangely works fine in IE 8 on Windows XP.</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload