This question already has an answer here:
I am a bit stuck, trying to use this jquery line to enter a result from a select option into a text area
This doesnt work
$("#id[txt_17]").val($(this).find("option:selected").attr("name"));
This does
$("#idtxt_17").val($(this).find("option:selected").attr("name"));
The [ ] are coded in via an oscommerce plugin and I have no idea of the importance of them, or what me removing them would do, but I am wondering if there is a workaround so I can leave them in. I tried creating a variable referencing the id but it still didnt work because of the square brackets.
Any help would be appreciated.
Thx
See: jQuery - Category: Selectors
replace:
with:
Example
Escape the brackets: