[英]jQuery Mobile: Issue with empty option in Select Menu (drop down list)
I have implenmented drop-down lists " Select menus " in jQuery Mobile.
我在
jQuery Mobile.
有出色的下拉列表 “ 选择菜单 ” jQuery Mobile.
<div data-role="fieldcontain">
<label for="name" class="select ui-select" style ="vertical-align:baseline; width:33%; " ><b>Application:</b></label>
<select name="select_choice" data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-hover-c" id="editWSAppType" >
<option value="EmptyOption">" "</option> <!--EMPTY OPTION-->
<option value="Other">Other</option>
<option value="Other2">Other2</option>
<option value="Other3">Other 3</option>
</select>
</div>
ALL THE OPTIONS ARE SHOWN IN DROP DOWN LIST but there is an issue of alignment of label. 所有选项都显示在“下拉列表”中,但是存在标签对齐问题。
I have used vertical-align:baseline
for now. 我现在使用了
vertical-align:baseline
。 And I tried other alignment attributes also. 我也尝试了其他对齐属性。
But in case of EMPTY OPTION the position of label is changed to down when compared to the other options . 但是,如果使用“空选项”,则与其他选项相比,标签的位置将更改为向下 。
So many select menus in my application are having the same problem. 我的应用程序中的许多选择菜单都存在相同的问题。
Some select menus doen't have any opstrong texttions these are also having the same issue. 某些选择菜单没有任何难以理解的文字,这些也具有相同的问题。
<div data-role="fieldcontain">
<label for="name" class="select ui-select" style ="vertical-align:baseline; width:33%; " ><b>Application:</b></label>
<select name="select_choice" data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-hover-c" id="editWSAppType" >
<!--NO OPTIONS-->
</select>
</div>
In the for
attribute of your label you should put in the the id
of your select (you currently have "name"
) 在标签的
for
属性中,应输入您选择的id
(您当前拥有"name"
)
<div data-role="fieldcontain">
<label for="editWSAppType" class="select ui-select" ><b>Application:</b></label>
<select name="select_choice" data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-hover-c" id="editWSAppType" >
<option value="EmptyOption"></option> <!--EMPTY OPTION-->
<option value="Other">Other</option>
<option value="Other2">Other2</option>
<option value="Other3">Other 3</option>
</select>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.