![](/img/trans.png)
[英]For a particular selected value from a drop-down box, Display its corresponding values in drop down list?
[英]Hide the selected value in the box for a drop down list HTML
我想知道是否有人知道如何始終將選定的文本隱藏在下拉列表的框中。 我希望所有選項都顯示在實際下拉列表中,但我希望框中的文本不可見。 DDL 是使用 MVC 框架中 c# 中的 HTML 幫助程序生成的。
@(Html.DropDownListFor(m => m.SelectedReadingsFilter, Model.FilterReadings, new {@onchange = "SubmitForm();", @class = "toolbar-button", @style= "top: -3px; cursor: pointer;" }))
我們可以將該文本的顏色設置為透明或類似的嗎?
謝謝!
只需在 model 后添加“”。 通常我們把“-select-”
Html.DropDownListFor(m =>
m.SelectedReadingsFilter,
Model.FilterReadings,"", new
{@onchange = "SubmitForm();", @class
= "toolbar-button", @style= "top:
-3px; cursor: pointer;" }))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.