Bug Tracker

Modify

Ticket #6891 (closed bug)

Opened 3 years ago

Last modified 15 months ago

Dynamic select box (size 5) does not refresh for single value until mouse over

Reported by: plohiya Owned by: plohiya
Priority: low Milestone: 1.5
Component: manipulation Version: 1.3.2
Keywords: select size Cc:
Blocking: Blocked by:

Description

I am using the below ajax code to populate a select tag. The code works fine for multiple values but fails for single value. I am not using Json its a java call.

HTML code: <select name="xx" id="xxSelect" size="5"></select> <img alt="Search" class="searchXX" src="xx" id="searchXX" />

jquery code: $('.searchXX').click(function(e) {

$.ajax({ type: "GET", url: "/x/x/xx/getxx.xml?xxName="+xxName , dataType: "xml", success: function(xml) {

Create Options from Response var options = ""; $('#xxSelect').html(options); $(xml, "root>xxxx").find("xxx").each(function() {

options+= '<option>'+$(this).find("xxName").text()+'</option>';

}) $('#xxSelect').html(options);

}

})

});

The above code works fine if i have a list of size more than 1 but fails if the 1st list was of size 1 and the second list was of size 1. ex: 1012 and 1013 fails as two different output values.

Change History

comment:1 Changed 3 years ago by SlexAxton

  • Status changed from new to pending
  • Component changed from ajax to manipulation
  • Priority set to low
  • Owner set to plohiya
  • Milestone set to 1.5
  • Keywords size added; box removed

Can you put this code into a working jsFiddle for us to check out. It helps us get through bugs like this much faster. Thanks so much!

comment:2 Changed 3 years ago by trac-o-bot

  • Status changed from pending to closed

Automatically closed due to 14 days of inactivity.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.