搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Can FF have a javascript function call a form's submit within a loop (multiple submits)?

more options

I have a page that allows a user to select multiple reports (links) to view. I have javascript code that works in IE that loops through all the "selected" checkbox objects and submits each "selected" report. Firefox will open the first report but does not open any others.

 function fnSubmit(report,role)
 {
    document.filing.REPORT.value = report;
    document.filing.fr.value = role;
    document.filing.submit();
 }
 function fnView()
 {
    var chkbox = document.getElementsByName("rpt");
    for (var i=0; i<chkbox.length; i++)
    {
       if (chkbox[i].checked==true) {
          link = document.getElementById(chkbox[i].value);
          link.onclick();
       }
    }
 }
</pre>

links look like: <input type="CheckBox" NAME="rpt" Value="23062"> <a id="23062" href="javascript:void(0)" onclick="javascript:fnSubmit('reportid',' ')">002 - Some Report</a>

Thanks for any help.

I have a page that allows a user to select multiple reports (links) to view. I have javascript code that works in IE that loops through all the "selected" checkbox objects and submits each "selected" report. Firefox will open the first report but does not open any others. function fnSubmit(report,role) { document.filing.REPORT.value = report; document.filing.fr.value = role; document.filing.submit(); } function fnView() { var chkbox = document.getElementsByName("rpt"); for (var i=0; i<chkbox.length; i++) { if (chkbox[i].checked==true) { link = document.getElementById(chkbox[i].value); link.onclick(); } } } : : : links look like: <input type="CheckBox" NAME="rpt" Value="23062"> <a id="23062" href="javascript:void(0)" onclick="javascript:fnSubmit('reportid',' ')">002 - Some Report</a> Thanks for any help.

所有回覆 (1)

more options

Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox.
http://forums.mozillazine.org/viewforum.php?f=25
You'll need to register and login to be able to post in that forum.