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 8226061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:37:59+00:00 2026-06-07T15:37:59+00:00

I am having issues with dynamically populating a select menu in jQuery mobile. When

  • 0

I am having issues with dynamically populating a select menu in jQuery mobile.

When I append the options, the initial value isn’t shown and I just get a blank line. The values are there and selectable when clicking on the menu, but it is just the initial view. It works fine when I hardcode the menu into the page. I would assume it is because I initially have an empty dropdown which is showing as it should and when appending, the view doesn’t know to update so keeps showing an empty line. Is there anyway I can force the view to update after I have appended? I’ve tried .trigger("create") but this does nothing.

Here is a screen showing what I mean. The “location” dropdown is the one I am having issue with and the “test” one is one I have hard coded to show what I am trying to achieve.

enter image description here

Here’s the HTML:

<label for="location" class="select">Location</label>
<select name="location" id="location"></select>
<label for="test" class="select">Test DD</label>
<select name="test" id="test">
  <option value="test1">Test 1</option>
  <option value="test2">Test 2</option>
  <option value="test3">Test 3</option>
  <option value="test4">Test 4</option>
  <option value="test5">Test 5</option>
</select>

And here’s the JS:

tx.executeSql('SELECT * FROM locations WHERE lDeleted != 1',
  [],
  function(tx,results){
    var len = results.rows.length;
    for (var i=0; i<len; i++){
      $('#location').append('<option value="'+results.rows.item(i).ID+
        '" class="dropDownBlk">'+results.rows.item(i).lTitle+'</option>');
    }
    $('#location').append('<option value="0">Add new location...</option>')
  },
  errorCB
);
  • 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-06-07T15:38:00+00:00Added an answer on June 7, 2026 at 3:38 pm

    This has done the trick:

    $("#location").trigger("change");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having issues with dynamically creating <select> tags and then populating them with XML values.
I'm having issues trying to append dynamically created html inside a SimpleModal box (OSX
I'm having some weird issues with dynamically populating a table in Javascript. Behold the
I'm having some issues in allocating memory for an array dynamically in C++ within
I'm having some trouble with a few routines that are using jQuery to dynamically
Having a very strange issue regarding postback in ASP.NET. I have page dynamically populating
i'm having issues retreiving the values out of a dynamically created dropdownlist. all controls
I am having issues of having an image change dynamically. Some background info: I
Am having a few issues with the Jquery Validation plug in, and wondering if
Having issues with Twitter Bootstrap responsive navigation. The best way to explain this is

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.