即時通訊相當新的PHP和我一直有麻煩的形式保存爲radioboxes,複選框的內存&(下拉)選擇列表中的形式,放或選擇將仍然存在,當我提交。表單輸入內存爲radioboxes,複選框和下拉(選擇)形式
\t \t <select name = "province[]" multiple size = "12">
\t \t \t \t
\t <?php foreach ($PROVINCES as $key => $value) {?>
<option value = "<?php echo $value ?>"<?php (in_array('$key',$_POST['province']))?'selected':'';?>><?php echo $value ?></option> \t \t \t \t
<?php }?>
\t \t \t \t </select> \t
\t \t \t <br><br>
\t <label for = "status">Status(Mult Select)<font color = "red">*</font></label>
\t <input type = "checkbox" name = "status[]" id = "Approved" value= "Approved"> Approved
\t <input type = "checkbox" name = "status[]" id = "Pending Application" value="Pending Application"> Pending Application
\t <input type = "checkbox" name = "status[]" id = "Active Service" value="Active Service"> Active Service
\t \t \t <br><br>
\t <label for = "location">Location<font color = "red">*</font></label>
\t <input type = "radio" name = "location" id = "Garage" value = "Garage"> Garage
\t <input type = "radio" name = "location" id= "Attic" value = "Attic"> Attic
\t <input type = "radio" name = "location" id = "House" value = "House"> House
\t \t \t </fieldset>
看到複選框的屬性['checked'](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/checkbox)。它也可以用於單選按鈕。 – HPierce