我正在尝试使用 javascript 提交表单。在 Firefox 3.6 中可以正常工作,但在 Firefox4.0 和 IE8 中不起作用。
代码:
<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='javascript: submitForm("<% $question->{ QuestionID } %>");' >View All< /a>)
</form>
</td>
</tr>
</table>
Javascript:
<script type='text/javascript'>
function submitForm(id) {
document.getElementById(id).submit();
}
</script>
任何想法有什么问题?