jQuery Mobile 1.1.1 Custom Select Menu - Placeholder Text not Visible

泪湿孤枕 提交于 2019-12-19 18:23:54

问题


After upgrading to jQuery Mobile 1.1.1 earlier today (7/13/2012) I noticed that all of my Custom Select menus no longer show the placeholder text on page load. Is there something I need to do differently in 1.1.1 to show the placeholder text in custom select menus? Help!?!?

Here's a sample of my code:

<div data-role="fieldcontain" class="ui-hide-label no-field-separator">
      <label for="ceiling" class="select" data-theme="a">Ceiling</label>
       <select name="ceiling" id="ceiling" data-theme="a" data-native-menu="false" class="required">
            <option data-placeholder="true">Ceiling (Yes/No)</option>
            <option value="Yes">Ceiling: Yes</option>
            <option value="No">Ceiling: No</option>
      </select>
</div>

Sample image (the black bars are my custom select menus):


回答1:


this code is working for me :

<select>
  <option value="" data-placeholder="true">Choose one:</option>
  <option value="1">One</option>
  <option value="2">Two</option>
</select>

Just put value="" on your placeholder option



来源:https://stackoverflow.com/questions/11476484/jquery-mobile-1-1-1-custom-select-menu-placeholder-text-not-visible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!