我在 PHP 中有一个带有下拉字段的表单,带有这个数组:
I have a form with a dropdown field in PHP with this array:
$field["options"] = array(
array("value" => "Chişinău", "text" => "Chişinău", "depth" => 0),
array("value" => "Bălţi", "text" => "Bălţi", "depth" => 0),
array("value" => "Comrat", "text" => "Comrat", "depth" => 0),
...
array("value" => "Ungheni", "text" => "Ungheni", "depth" => 0)
);
如何将添加为第一个选项?
How to add as a first option the <option selected disabled>Choose one</option>
?
$field["options"] = array(
array("value" => " ", "text" => "Choose one", "depth" => 0, "selected" => "selected", "disabled" => "disabled"),
//...rest other option code
);
这篇关于在 PHP 中禁用添加选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!