MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - Javascript document.form.submit() not working with Firefox 4.0

WebPagetest Forums

Full Version: Javascript document.form.submit() not working with Firefox 4.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
Thanks for the valuable information.
(04-05-2011 06:35 PM)sathyanpry Wrote: [ -> ]Thanks for the valuable information.

try using this

document.forms[form].submit();
Reference URL's