【发布时间】:2015-10-13 16:20:17
【问题描述】:
我有一个选择列表,但是在页面重新加载时,列表中的数据没有保存。 通过从 $_GET 读取变量,我已经使用 TextBoxes 和 Radio 按钮解决了这个问题。 这是我现在的表单示例:
<form action="" id="exampleForm" method="get">
<input type="checkbox" name="exampleCheckbox" <?php if (isset($_GET['exampleCheckboxStatus'])) {echo "checked";} ?>>Check this
</br>
<select name="exampleList" multiple>
<option>Apple</option>
<option>Banana</option>
<option>Cherry</option>
</select>
<input type="submit" value="Submit" id="submitButton"> </form>
我想在提交后保留“exampleList”的值 (我留在同一页面上)
我在这里看到的帖子几乎看起来像我问的那样,但他们中的大多数都想使用 javascript。我的问题是否有解决方案,看起来与我现在已有的相似?我想用 php 解决这个问题,因为我认为我对 Javascript 的了解不够(还)
【问题讨论】:
标签: php html forms drop-down-menu reload