PDA

View Full Version : Help with Chained Select Menu



montero
05-25-2006, 02:09 AM
This question is about the Chained Select Menu script found here:

http://www.dynamicdrive.com/dynamicindex1/chainedmenu/chainedmenu.html

I'm using this and I want to send the options selected in the various dropdowns all summarized in an email. I have set up the configuration correctly, however the "option text" is different from "option value" (as it should be).

Here's an excerpt of the config file:

addList("cs-top", "for publication", "1", "cs-sub-1");
addOption("cs-sub-1", "Advertising", "3", 1);


Everything works but when I submit the form, what I get in the email is only the "option value". For example, in case of the excerpt above, I only get "3" in the email. What I want is "Advertising", which is the option text, to be sent in the email as well so that when I submit the form, I get an email saying

Advertising 3

How do I access the option text values?

Sorry if this isn't clear.

Thanks.

montero
05-25-2006, 11:55 PM
I emailed the script developer last night and he suggested just appending the option text to the option value field. Duh! Why didn't I think of that

so following my example, I would have:

addList("cs-top", "for publication", "1", "cs-sub-1");
addOption("cs-sub-1", "Advertising", "Advertising 3", 1);

Then if you need to separate it when you send to the server (e.g. in php so I can do other stuff like calculate some stuff), I just split the string into two: "Advertising" and "3".

Hope this helps someone...