Mike Alsup wrote:
> Hold the phone. I think I've got a fix for this...
>
Sweet! This will potentially solve my latest nightmare dealing with
quote escaping.
I convert some plain text into a defined select box with the text
showing showing up as the selected option. This was fine until I had to
incorporate the value attribute (for IE) and thus quote escaping .
Cosider this code;
<!-- the predefined select -->
<select style="display: none;" id="s1">
<option value="ABC">ABC</option>
<option value="DEF">DEF</option>
<option value="wi'th"qu&&s">wi'th"qu&&s</option>
</select>
<!-- The Cell -->
<td>wi'th"qu&&s</td>
$('td').each(function() {
var select = $('#s1').clone();
select.removeAttr('id');
select.val($(this).html()).show(); // set value of select, unhide
$(this).html('').append(select); // replace cell with select
});
What happens is the cell gets replaced with the select element, but {
ABC } is shown as the selected value instead of { wi'th"qu&&s } .. now
if only I were able to use <option>wi'th"qu&&s</option> and have
$.val() retrieve this! :)
~ Brice
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/