Hi all,
I'm trying to build 2 drop-down lists. When the first (list A) drop-down is selected and an item is picked, the JS will automatically populate the second (list B) drop-down list. I have it working for most items. However, if list A contains an item with a "&" character, such as "copy&paste", then list B does not automatically get processed by the JS. Maybe the JS isn't recognizing the characters.
here is some of list A:
<option value="copy\&paste" >copy&paste</option>
here is some of the JS for doing the auto populating of list B:
if (categoryList[categoryList.selectedIndex].value == "copy\&paste") {AddToOptionList(document.formCreate.create_type, "do something", "do something");
AddToOptionList(document.formCreate.create_type, "do something else", "do something else");
AddToOptionList(document.formCreate.create_type, "do both", "do both");
}
note: I made "&" become "\&" because I read that JS doesn't like the "&" character by itself. And I made "&" become "&" so that it is good html for a web browser.
Any ideas why this isn't working?
Thank you in advance.
I'm trying to build 2 drop-down lists. When the first (list A) drop-down is selected and an item is picked, the JS will automatically populate the second (list B) drop-down list. I have it working for most items. However, if list A contains an item with a "&" character, such as "copy&paste", then list B does not automatically get processed by the JS. Maybe the JS isn't recognizing the characters.
here is some of list A:
<option value="copy\&paste" >copy&paste</option>
here is some of the JS for doing the auto populating of list B:
if (categoryList[categoryList.selectedIndex].value == "copy\&paste") {AddToOptionList(document.formCreate.create_type, "do something", "do something");
AddToOptionList(document.formCreate.create_type, "do something else", "do something else");
AddToOptionList(document.formCreate.create_type, "do both", "do both");
}
note: I made "&" become "\&" because I read that JS doesn't like the "&" character by itself. And I made "&" become "&" so that it is good html for a web browser.
Any ideas why this isn't working?
Thank you in advance.