开发者

Drop down list that doesnt show the first element?

开发者 https://www.devze.com 2023-03-08 08:11 出处:网络
How can I create a drop down list that doesn\'t show when You expand the drop down list? (because the first element has text \"Please make selection\" and no 开发者_开发百科value. Plus, it looks bad w

How can I create a drop down list that doesn't show when You expand the drop down list? (because the first element has text "Please make selection" and no 开发者_开发百科value. Plus, it looks bad with the please select in the list right under the same text.


You can either create an option group (example here) so that it's not selectable, or just leave the first option blank and add your own validation for the dropdown. A blank one would just be:

<option value="-1"></option>


It isn't possible immediately from the server-side. You'll have to include a special option, and add some CSS and javascript. See this question for a solution (and check out the JsFiddle he added).

0

精彩评论

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