这是示例代码。
<form id="form1" name="form1" action="phpPage.php" method="POST">
<!--5 diff values in form1 . . . -->
<input id="b1" onclick="functionOne();">
</form>
<form id="form2" name="form2" action="phpPage.php" method="POST">
<!-- 5 diff values in form2 . . . -->
<input id="b2" onclick="functionTwo();">
</form>
我最多有 8 个表格。
问题是,当我单击按钮 b5
时,在执行所有验证检查后,我需要它,以便它发送来自 form1
-form5 的所有值
。我通过 jQuery 收集了 JS 函数 (functionFive()
;) 中的值。如何将这些值发送到 phpPage.php
?
请记住,我们已在 b5
上触发了 onclick
事件,因此,已调用 functionFive
进行验证检查。如何将值从这里发送到 php 页面?
最佳答案
答案是使用包含所有值的一种形式。
关于php - 将多个值从 javascript 函数发送到 PHP 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14266254/