Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:04:04+00:00 2026-05-31T10:04:04+00:00

Using jQueryMobile, when I change the contents of a select widget and then call

  • 0

Using jQueryMobile, when I change the contents of a select widget and then call ‘refresh’ on it, the text of the selected option is not changed. Here’s the scenario…

The ‘select’ widget exists in the page div already. When the user goes to that screen, the options are dynamically created based on the button they selected to go to that page. This option list is built and added as per

$('#searchReasonList').append(optionList)

The first time into the new page all works well. When they navigate away and come back in, I do

$('#searchReasonList').empty()

Then I build the correct option list and do the same append and call:

$('#searchReasonList').selectmenu('refresh',true)

The native select is indeed refreshed, and I am able to choose from the options. However, the selected option doesn’t show up. Only the placeholder is seen.

To show the enhanced markup:

<div class="ui-select">
  <div class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-c" data-theme="c">
    <span class="ui-btn-inner ui-btn-corner-all">
      <span class="ui-btn-text">Select Reason</span>
      <span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span>
    </span>

    <select id="searchReasonList" name="searchReasonList" data-placeholder="true">
      <option value="">Select Reason</option>
      <option value="1">Option 1</option>
      <option value="2">Option 2</option>
    </select>
  </div>
</div>

It’s that span tag with class='ui-btn-text' that is not being updated with the selected option’s label. It just stays “Search Reason”, which is the label of my placeholder.

Is there something else that needs to be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:04:05+00:00Added an answer on May 31, 2026 at 10:04 am

    Using jQuery 1.0.1 (latest stable version at this time) you can use .selectmenu('refresh') to refresh a select-widget.

    $('select').empty().append('<option value="foo">Bar</option>').selectmenu('refresh');
    

    Here is a demo: http://jsfiddle.net/4Thzt/

    When you use $('select').selectmenu('refresh', true); (notice the , true), you are forcing the widget to not only be refreshed, but rebuilt, which will always show the placeholder text. Source: http://jquerymobile.com/demos/1.1.0-rc.1/docs/forms/selects/methods.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquerymobile for developing app. I want to change the UI(button,list) colors,text
I am using jQueryMobile 1.1-rc1 and my pageloading indicator is not displaying correctly. I
I am using the jquery Mobile with multiple select option and data-native-menu as false.
Im using jquerymobile together with codeigniter framework and I'm having a problem I have
I have just started getting a very strange error when using jQueryMobile for my
I'm using PhotoSwipe 3.0.4 with jQueryMobile 1.1-rc1. I'm trying to prevent PhotoSwipe from hiding
Using jQueryMobile, I've included data-role=footer data-position=fixed in the markup, but two bugs persist: Footer
I'm trying to put together a horizontal content slider using JQueryMobile. The following code
I'm developing an HTML5 app using PhoneGap + JqueryMobile. My problem is when I
I am using jQuery Mobile with jQuery Mobile Router , to dynamically change content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.