Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使 HTML 复选框在 PHP 脚本处理表单后保持选中状态(当用户选中它时),并且如果用户重新访问表单并使其未选中,同样保持未选中状态。
像这样做。myCheckbox可以是任何你想要的。
myCheckbox
<input type="checkbox" name="myCheckbox" <?php if ($_REQUEST['myCheckbox']) echo 'checked'; ?>>