Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retreiving multiple select options

Status
Not open for further replies.

nadskram

Programmer
May 21, 2001
41
US
I have this javascript that populates a select box when you click on an option in a different select box. Once you are done selecting, i want to send the form with the options to another page that uses ASP to be loaded in the database, but when i get to the other page, it doesnt get either one of the select boxes or their options.

Is there a way to get to the subset of form data?
What am I missing?
 
What names r u using for the select boxes .. if u are using the same names then you need to loop through the array and only the selected option will be submitted to the server.
And also check out the method which u are using... post or get .. and use respective ways to get the details...


srinu...
 
i have some hidden fields for id purposes, and they come through. its the select boxes that dont come through.

I beleive the javascript just puts the option value and text in the second select box, but doesnt actually select them. the original script just threw up an alert box, and i want those values passed to another page.

i was thinking of building a string var like opt1=32&opt2=48 or if i could make a hidden field an array.
 
so i just changed the javascript to keep all the options selected when going to the next page and they come out.

sometimes just talking out the problem will reveal the solution
 
yes u can pass all the values after formatting in string and putting in the text box as "opt1=12,opt2=33". And in the next page u need to break the string to get the values .. or if u want to stick to the select box then u need to select all the options which u need to select .. remember that has to be a multiple select box ...

All the values which u select will be sent to the server with the select box name as reference ... u cn select the options using javascript .. as u populate the list box ...

srinu...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top