Chandusangale / dropdown-check-list

Automatically exported from code.google.com/p/dropdown-check-list
1 stars 0 forks source link

'&' in select list not displayed correctly #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you add an item to a select list with an '&' in the item, only the contents 
up to the & will be displayed unless there is an item selected below it.  For 
instance, if you had 3 items in a select control, 'Test1', 'Test1&Test2', 
'Test2', when 'Test1&Test2' is selected it will just display 'Test1'.  However, 
if 'Test1&Test2' and 'Test2' are selected, both are displayed correctly, 
'Test1&Test2, Test2'.

-- DropDownCheckList version: 1.1
-- jQuery version: 1.4.2
-- jQuery UI version: 1.8.4
-- Browser and version: IE8

Possible Fix:
On line 484 if you replace 'text += $(this).text();' with 'text += 
$(this).text().replace("&","&");' then the selected item will be displayed 
correctly.

Example Select:

<select id="Sample" multiple="multiple">
    <option value="1">Test1</option>
    <option selected="selected" value="2">Test1&Test2</option>
    <option value="3">Test2</option>
</select>

Original issue reported on code.google.com by JRLamp...@gmail.com on 4 Oct 2010 at 8:13

GoogleCodeExporter commented 9 years ago
Note to self -- look for a jQuery service routine to handle special characters 
in text strings.

Original comment by womohun...@ittrium.com on 6 Oct 2010 at 1:36

GoogleCodeExporter commented 9 years ago
While building a test case for this problem, I was unable to duplicate it.  
Ampersands within option text seem to work fine, and I have included examples 
in the Demo and Tests pages.  If you have an example where it fails, please 
attach.

Original comment by womohun...@ittrium.com on 17 Jan 2011 at 4:25

GoogleCodeExporter commented 9 years ago
Attached is a test that shows that when the item with the & in it is selected 
only the portion before the & is displayed when the drop down list is closed.

Note: It displays correctly in Firefox 3.6.13, but not in IE8.

Original comment by JRLamp...@gmail.com on 17 Jan 2011 at 11:51

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,
the "possible fix" proposed don't resolve the problem, but move it...
now the content is ok, but the title of select list display a & instead of &.

Try this possible fix:
(version 1.1 on line 462):
replace 'controlLabel.html(text);' with 
'controlLabel.html(text.replace("&","&"));'

(version 1.2qa on line 502):
replace 'controlLabel.html(text);' with 
'controlLabel.html(text.replace("&","&"));'

Tested on IE6, IE7, IE8, FF3.1.16

Original comment by amedeo.z...@gmail.com on 21 Jan 2011 at 9:08

GoogleCodeExporter commented 9 years ago
Fixed in 1.3

Original comment by womohun...@ittrium.com on 13 Apr 2011 at 5:01