我有一个我正在使用 PHP 处理的表单。在用户提交之前,重置按钮起作用。但是当他们提交并且页面重新加载时(我已经根据 $_POST 值使表单字段保持粘性)重置不起作用。我该如何解决?编辑:例如,表单上的复选框:
<input type="checkbox" <?php if (isset($_POST['cb12'])){echo 'checked="checked"';} ?> name="cb12" tabindex="34" id=cb value="Education">
和 HTML:
<tr>
<td colspan="5" valign="top" class="addit" ><div class="sectionbreak topsp" >
<input type="hidden" name="failure" value="failure.html" >
<p>
<input type="submit" name="Submit" value="Submit" tabindex="49">
Sends your application by email to The Boggs</p>
<p>
<input type="reset" name="Reset" value="Reset" tabindex="50">
Clears all the fields</p>
</div></td>
</tr>
编辑:最后,如果表单已提交(但不完整),我只是隐藏了按钮。也许没有人会注意到。