WebPagetest Forums
Javascript document.form.submit() not working with Firefox 4.0 - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: Javascript document.form.submit() not working with Firefox 4.0 (/showthread.php?tid=642)



Javascript document.form.submit() not working with Firefox 4.0 - sathyanpry - 04-04-2011 07:57 PM

Hi

I'm trying to submit a form with javascript. Works fine with Firefox 3.6, but in Firefox4.0 and IE8 doest work fine.

Code:
<table>
<tr>
<td>
<form action='results.html' method='post' target='_blank' id='<% $question->{ QuestionID } %>'>
<input type='hidden' name='SurveyID' value='<% $surveyid %>'
<input type='hidden' name='responses' value='<% join ",", map { $_->{ srid } } @textresults %>' />
<input type='hidden' name='question' value='<% $question->{ QuestionID } %>' />
Total Responses: (<a href='j submitForm("<% $question->{ QuestionID } %>");'>View All</a>)
</form>
</td>
</tr>
</table>

J

<script type='text/javascript'>
function submitForm(id) {
document.getElementById(id).submit();
}
</script>

Any Idea???

Thanks ahead for any help;
Sathyan


RE: Javascript document.form.submit() not working with Firefox 4.0 - pmeenan - 04-05-2011 07:35 AM

You may get some help here by random luck because there are a lot of web developers but generaly the discussions here are focused on web performance, not general programming. You might have better luck over at stackoverflow.


RE: Javascript document.form.submit() not working with Firefox 4.0 - sathyanpry - 04-05-2011 06:35 PM

Thanks for the valuable information.


RE: Javascript document.form.submit() not working with Firefox 4.0 - eas vox - 04-06-2011 09:08 PM

(04-05-2011 06:35 PM)sathyanpry Wrote:  Thanks for the valuable information.

try using this

document.forms[form].submit();