开发者

Form input type option problem

开发者 https://www.devze.com 2023-03-26 05:45 出处:网络
echo $this->Form->input(\'country\', array(\'type\' => \'select\', \'options\' => $country_l开发者_如何学Goist));
echo $this->Form->input('country', array('type' => 'select', 'options' => $country_l开发者_如何学Goist));

This generates a select box with all the countries. But I'd like the default to be empty. I looked into the manual and setting 'selected' => '' does not work either.

Any ideas? Thanks


Try 'empty' => '' in the options array. You can also set it to any other value you'd like.

0

精彩评论

暂无评论...
验证码 换一张
取 消