我正在尝试自动提交一个表单,(它下面只是表单,它用一段时间包装了{},以便显示每个数据库条目)。它适用于一周中的所有日子,但如果没有像 onfocus() 这样的 js 事件,我无法提交 $totalhours、$holidayhours、$wagegross 的值。
基本上我想提交这 3 个输入而无需单击或任何其他手动操作。
任何的想法 ?
<form id="weeklysheet" name="weeklysheet" method="post" action="hourly-function.php">
<tbody>
<tr style="line-height:0px;">
<td class="large">
<p class="employee_name"><?php echo $fullname?></p>
</td>
<td class="small">
<input name="mon" id="mon" type="text" class="days_input" value="<?php echo $data['mon'];?>"onchange="this.form.submit();"/>
</td>
<td class="small">
<input name="tue" id="tue" type="text" class="days_input" value="<?php echo $data['tue'];?>"onchange="this.form.submit();"/>
</td>
<td class="small">
<input name="wed" id="wed" type="text" class="days_input" value="<?php echo $data['wed'];?>"onchange="this.form.submit();"/>
</td>
<td class="small">
<input name="thu" id="thu" type="text" class="days_input" value="<?php echo $data['thu'];?>"onchange="this.form.submit();"/>
</td>
<td class="small">
<input name="fri" id="fri" type="text" class="days_input" value="<?php echo $data['fri'];?>"onchange="this.form.submit();"/>
</td>
<td class="small">
<input name="sat" id="sat" type="text" class="days_input" value="<?php echo $data['sat'];?>"onchange="this.form.submit();"/>
</td>
<td class="small">
<input name="sun" id="sun" type="text" class="days_input" value="<?php echo $data['sun'];?>"onchange="this.form.submit();"/>
</td >
<td class="small">
<input name="totalhours" id="totalhours" type="text" class="cumul_week_input" value="<?php echo $totalhours ?>"onfocus="this.form.submit();"/>
</td>
<td class="small">
<input name="holidayhours" type="text" class="cumul_week_input" value="<?php echo $holidayhours ?>"onfocus="this.form.submit();"/>
</td>
<td class="small">
<input name="wagegross" type="text" class="cumul_week_input" value="<?php echo $wagegross ?>"onfocus="this.form.submit();"/>
</td>
<td>
<input type="submit"name="save" id="save" value="Confirm" style="display:none;" />
</tr>
</tbody>
</form>