【发布时间】:2020-08-24 21:17:34
【问题描述】:
我需要帮助....
我正在尝试使用 xmlhttlrequest 通过一个提交按钮发送多个表单。但每次它只发送最后一个表单。
这是我的代码
for(j=0;j<collection;j++)
{
xhr.open("POST", "showQuestionnaire.php",true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(document.getElementById("submitAnswers"+j).submit());
}
我正在尝试在同一页面上使用 .submit() 提交表单并使用 $_GET 获取数据。但每次它都会跳过索引 0。
【问题讨论】:
-
我们还需要查看您的 html 部分
标签: javascript php forms xmlhttprequest multiple-forms