Ticket #6891 (closed bug)
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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!