greenhive
01-27-2005, 08:59 PM
I wonder if anyone can help me with this. I have a combo box on my page just like this one http://javascript.internet.com/forms/form-swapper-2.html
But, I don't know how to access the selections a user might make. Does anyone know how to do this?
thanskmuch
A couple of options here
In the opening tag
onchange="options[selectedIndex].value"
Scriptwise
document.formname.selectname.options[document.formname.selectname.selectedIndex].value;
greenhive
01-27-2005, 10:32 PM
Thanks for helping.
In my particular version the combo box opens in a new <div> layer because it has many options and each option is pretty long (so it wouldn't look good if just left on the main page.)
I have a SAVE button which selects the added options (the ones the user has put into the right hand <select>) and what I want it to do is have a script write the text of the selections into a <textarea> on the main page.
My problem is, right now my SAVE button appends the index of the selections to the url, for instance, like this
http://www.mypage.com?list2=1&list2=4
(list2 being the right hand <select> box in the combo.)
AS you can see, it works in that it gives me the index of the selections, but what I have no clue about is how do I get at those values in the url.
Is there a way to access those values in the URL? (so that the associated text can be written into a textarea)
thanks for help.
Take a look here for information about transfering data to another page, this might help you.
www.huntingground.freeserve.co.uk/scripts/passdata/p_data1.htm