Javascript 在以具有多个条目的表单提交之前,在同一页面上显示添加的值
我想向现有表单添加功能。到目前为止,我的表单只允许每次提交的条目,这意味着如果用户想添加其他条目,他/她必须返回表单并添加,然后再次单击提交。我想在同一页面上显示所有添加的值,因为我计划添加一个Javascript打印函数,在保存到数据库之前打印add条目。我需要打印字段中的所有值Javascript 在以具有多个条目的表单提交之前,在同一页面上显示添加的值,javascript,php,html,Javascript,Php,Html,我想向现有表单添加功能。到目前为止,我的表单只允许每次提交的条目,这意味着如果用户想添加其他条目,他/她必须返回表单并添加,然后再次单击提交。我想在同一页面上显示所有添加的值,因为我计划添加一个Javascript打印函数,在保存到数据库之前打印add条目。我需要打印字段中的所有值 <form method="POST" name="myForm" action="saveto.php"> <label> Speed Rating:</label> &
<form method="POST" name="myForm" action="saveto.php">
<label> Speed Rating:</label>
<select name="speed_rating" required class="form-control" id="speed_rating" ></select>
<div class="form-group col-sm-8">
<label> Description:</label>
<select name="description" required class="form-control" id="description" >
</select>
</div>
<div class="form-group col-sm-4">
<label> Load Index:</label>
<select name="load_index" required class="form-control" id="load_index" >
</select>
</div>
<div class="form-group col-sm-6">
<label> Vendor:</label>
<select name="vendor" required class="form-control" id="vendor" >
</select>
<div class="note"> Recommended Vendor : <span id="recomvend"> </span> </div>
</div>
<div class="form-group col-sm-6">
<label> Quantity:</label>
<input type="text" required name="qty" class="form-control" id="qty"></div>
<div style="clear:both"> </div>
<input type="submit" name="submit" class="btn btn-primary smp" value="Submit">
<button id="clear" type="button" class="btn btn-primary smp smp2" > Reset </button>
</div>
<input type="submit" value="submit" name="submit">
</form>
entry 1
speed rating -- 46
description ---'the discription'
------
entry 2
speed rating --56
description ---'another description'
submit
额定速度:
说明:
负荷指数:
小贩:
推荐供应商:
数量:
重置
条目1
额定速度——46
描述--“描述”
------
条目2
额定速度——56
描述--“另一个描述”
提交
saveto.php
只是一个普通的脚本,它将把提交的数据处理到数据库中,每次提交一个条目