Getting Everything from a <select multiple>

J

Jayenkai

http://jnk.homedns.org/cgi-bin/formforfone1.pl

^^ I've finally downloaded the script I needed to move those little
items about my 4 columns..
But now I've stumbled across a slight problem.
I can't actually figure out what's IN each list, without requireing
that each list has it's items selected before the user clicks Send.

Does anyone know how I can access the results from this page, or of
any other alternative?
 
T

Tobias Wolff

Jayenkai said:
http://jnk.homedns.org/cgi-bin/formforfone1.pl

^^ I've finally downloaded the script I needed to move those little
items about my 4 columns..
But now I've stumbled across a slight problem.
I can't actually figure out what's IN each list, without requireing
that each list has it's items selected before the user clicks Send.

Does anyone know how I can access the results from this page, or of
any other alternative?

You have got two alternatives:

1. Either you remember these items you added in a javascript array, so
that on submit you can pass these items to the target script by setting
some hidden fields in the form.

2. You can gather the items inside of selects by using it's "options"
property.

var strItems = '';
for(intI = 0; intI < objSelect.options.length; intI++)
{
strItems += objSelect.options[intI].value; // or ___.text;

if(intI < objSelect.options.length - 1)
{
strItems += ',';
}
}

Now you have got a comma separated list of all items in the list and
pass them to the script with a hidden field.

Hope this helps,
Tobias.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top