<div id="form1" />
<form name="choice">
<table>
<tr>
<td>
Number of new types you want to add
</td>
<td>
<select name="<?php echo $num; ?>">
<option value="1" selected>1 row</option>
<option value="2">2 rows</option>
<option value="3">3 rows</option>
<option value="4">4 rows</option>
<option value="5">5 rows</option>
</select>
<div class='inputs'></div>
</td>
</tr>
</table>
</form>
<form name="myForm" action="addAccessories.php" method="post" onsubmit="return validateForm(this);">
<table border="1">
<tr>
<th>Barcode<em>*</em></th>
<th>Description<em>*</em></th>
<th>Minimum required stock<em>*</em></th>
<th>Current stock</th>
</tr>
<?php
echo $num;
?>
<tr>
<td><input type="text" name="bar_code/></td>
<div class="ui-widget">
<td><input name="description/></td>
</div>
<td><input type="text" name="minimum_required_stock" /></td>
<td><input type="text" name="num_stock" value="0"></td>
<tr>
<td> </td>
<td> <button data-theme="b" id="submit" type="submit">Add accessories</button></td>
</tr>
</table>
</form>
大家好, 在这段代码中,我有 2 个表单,1 个是下拉框,有 5 个选项和一个用于文本输入的表单。理论上,如果我选择选项 value="3",文本表单将循环 3 次并获得 3 组文本输入。但是,到目前为止,我还没有成功地做到这一点。另外,如何访问 addAccessories.php 文件中的这 3 组数据?
我很欣赏关于这个话题的任何意见。非常感谢。