Forum Moderators: open

Message Too Old, No Replies

Dynamic Option List

Javscript Dynamic Option List

         

emraydn12

1:28 pm on May 4, 2008 (gmt 0)

10+ Year Member



Hello,
I am using dynamic option list, the basic one (with two select boxes) and I have a question about it. The script can be found in here: [mattkruse.com...]

When I use:
regionState.forValue("main").addOptions("sub1","sub2","sub2");

The newly formed Options by javascript only makes it like that:
<option value="sub1">sub1</option>
<option value="sub2">sub1</option>
<option value="sub3">sub1</option>

So, 'value' and 'shown text' is the same. But in my site, they should be different.

I should be able to do that:
<option value="sub3">blablabla</option>

How can I do this?

penders

4:58 pm on May 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is specific to the particular script you are using, rather than being a generic JavaScript query, but the documentation does state:
// If the options you want to add should have different values and dislplay 
// text, you can do that
dol.forValue("Value1").addOptionsTextValue("Text2","Value2");

emraydn12

3:49 pm on May 5, 2008 (gmt 0)

10+ Year Member



I tried to use it, but it ended with failure...

Edit: I finally got what I want. Thanks...