Note that there are some explanatory texts on larger screens.

plurals
  1. POdocument.form.submit() not working in IE10
    primarykey
    data
    text
    <p>I have a form in JSP where I have created a hidden variable. When I unload this JSP page (checked using window.onunload), I am calling a js method, where I am setting the value of the hidden variable and submitting the page using document.forms[0].submit. The expected result is, after submit application should update a field with this hidden variable value.</p> <p>This is working fine in IE7, but doesn't work in IE10. I believe there is some problem in document.forms[0].submit. Because I have put alert before and after this line. But I can see only one alert that is put befor the line. Second one is not coming up. So there must be some issue in line document.forms[0].submit.</p> <p>I am highlighting part of my code -</p> <p><strong>JSP page :</strong></p> <pre><code>&lt;html:html &gt; &lt;head&gt; &lt;script type="text/javascript"&gt; window.onunload=function(){saveField(document.getElementById('txt_field1'));} &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;html:form action='&lt;%="/someAction.do?time="+ Calendar.getInstance().getTimeInMillis() %&gt;' method="post" enctype="multipart/form-data" &gt; --- some code --- &lt;/html:form&gt; &lt;/body&gt; &lt;/html:html&gt; </code></pre> <p><strong>JS Code :</strong></p> <pre><code>function saveField(obj) { var var1=trim(obj.value); document.getElementById('hidden_field').value = 'SOME_VALUE'; document.forms[0].submit(); } </code></pre> <p>We are using struts 1.3 as our framework.</p> <p>Please help me to resolve this issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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