I have a webpage that needs to display a unique set of options in a dropdown based upon the country a user selects in another area of the page. The dropdown needs to be dynamic. I am using the following (in part) to load the select with options:
selbox.options[selbox.options.length] = new Option('UPS Worldwide Express(sm)','07');
I would like to replace the (sm) in the above with the ISO-8859-1 charset value of & # 8480 ;
The problem is that the ISO-8859-1 characters do not display as the superscripted Service Mark <sup>sm</sup>
I'm somewhat new to javascript and was thinking that there might be a way of concatenating to get it to work but have yet to discover how despite Googling and searching this forum. Any ideas?
Thank you,
Rich
I use a swich statement to find the country. An example for Puerto Rico is below
case "PR":
selbox.options[selbox.options.length] = new Option('UPS Ground','03');
selbox.options[selbox.options.length] = new Option('UPS Next Day Air ®' ,'01');
selbox.options[selbox.options.length] = new Option('UPS Next Day Air ® Early A.M. ®','14');
selbox.options[selbox.options.length] = new Option('UPS Second Day Air ®','02');
selbox.options[selbox.options.length] = new Option('UPS Worldwide Express(sm)','07');
selbox.options[selbox.options.length] = new Option('UPS Worldwide Express Plus(sm)','54');
selbox.options[selbox.options.length] = new Option('UPS Worldwide Expedited(sm)','08');
for(var i = 0; i < selbox.options.length; i++)
{
if (selbox.options[i].value == chosenval)
selbox.options[i].selected=true;
}
break;
the (sm) is what I'd like to have replaced by a supersecripted Service Mark. The question I have involves concatenation in JavaScript. I'm guessing that 'new option' creates and option object in the DOM and that interpretation of these codes can't take place inside these objects at creation time...??
Thanks for the reply!
Bookmarks