Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12210 closed bug (invalid)

BUG IN DYNAMICALLY CREATING SELECT INPUT TYPE USING JQUERY MOBILE

Reported by: mgsriram90@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.3
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

Am using jquery mobile V 1.0b2 and jquery V 1.6.2 . and here is my problem while am developing,

I'm creating a select Options dynamically under a div tag using jquery. I have set the first item as selected using selected attribute. But i couldn't able to see the text for first item in select list. if i select second or third item its showing the text in select list. In order to get first item's text in select box, i need to select other than first item before. after that i need to select the first item.

If i remove jquery mobile script link in HTML document its working perfectly.

and my HTML code :

<select id="HRselectList"></select>

my Js code :

for(var x = 0; x <= 5; x++)
{
  $('#HRselectList').append($("<option></option>").attr("value",x).text(x));
  if(x==0)
  {
    $('#HRselectList option').attr("selected","selected");
  }
}

For more, stackoverflow page for my question : http://stackoverflow.com/questions/11778455/need-help-in-dynamically-created-select-option-tag-using-jqueryfor-jquery-mobil

Change History (1)

comment:1 Changed 7 years ago by dmethvin

Resolution: invalid
Status: newclosed

It seems like you already chose the correct forum, StackOverflow. You're asking about older versions and not reporting a bug here.

Note: See TracTickets for help on using tickets.