I was wondering if anyone knows how to always hide the selected text in the box of a drop down list. I want all options to show in the actual drop down, but i want the text in the box to be not visible. The DDL is generated using the HTML helper in c# in MVC framework.
@(Html.DropDownListFor(m => m.SelectedReadingsFilter, Model.FilterReadings, new {@onchange = "SubmitForm();", @class = "toolbar-button", @style= "top: -3px; cursor: pointer;" }))
Can we set that text's colour to transparent or something like that?
Thanks!
Just add "" after the model. Normally we put "-select-"
Html.DropDownListFor(m =>
m.SelectedReadingsFilter,
Model.FilterReadings,"", new
{@onchange = "SubmitForm();", @class
= "toolbar-button", @style= "top:
-3px; cursor: pointer;" }))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.