6

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): enter image description here

Serge P
  • 1,173
  • 3
  • 25
  • 39
adamdehaven
  • 5,890
  • 10
  • 61
  • 84
  • 2
    Looks like a bug, submit issue here: https://github.com/jquery/jquery-mobile/issues/4696 – Phill Pafford Jul 13 '12 at 21:32
  • They should have a workaround for this and fixed in the maintenance release 1.1.2 – Phill Pafford Jul 15 '12 at 03:24
  • (I know this is probably a dumb question) Any idea when 1.1.2 will be released? Estimate? I'm releasing an app that is based on this and it would be nice if this was fixed pre-release. – adamdehaven Jul 16 '12 at 12:28
  • if you just need to fix you can download it here: http://jquerymobile.com/test/docs/forms/selects/custom.html or maybe just use the test jQM: http://jquerymobile.com/test/js/jquery.mobile.js until 1.1.2 is released – Phill Pafford Jul 16 '12 at 14:55
  • There is a patch, could you please confirm? https://github.com/jquery/jquery-mobile/issues/4696 – Phill Pafford Sep 04 '12 at 12:33
  • Are you talking about the comment by @MauriceG ? The `data-placeholder` seems to work there, but I don't see that he did anything different in his markup. Is there a way for me to view the actual patch? (or am I looking at the wrong item?) – adamdehaven Sep 04 '12 at 13:45
  • you will need to look over the latest jQM code: http://code.jquery.com/mobile/latest/jquery.mobile.js – Phill Pafford Sep 04 '12 at 15:49
  • In my testing, the issue still exists. I'm following the Github post and the jQuery Mobile official site for any updates. I've changed my select menus to the native "style" for the time being, but would appreciate a post if anyone hears anything before I do :) – adamdehaven Sep 04 '12 at 21:31

1 Answers1

-2

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

Random78952
  • 1,520
  • 4
  • 26
  • 36