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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading all options of a select element in a form

Status
Not open for further replies.

meenu24

Programmer
May 5, 2006
37
US
Hi,

When I submit the form, to the servlet my servlet should read all the options of the select element in the form. For this to happen user need not necessarily select all the options. Please let me know if there is a way we could do this.

Thanks for your time

Meena
 
The form will only submit the single option that was chosen. The rest of the data is not sent (so your servlet can't get it).

If you want to send all the options back, you could populate a hidden field containing all the data and access that server-side.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
thanks Baby Jeffy for a qiuck response. My options values are of two types, generated from DB and also some of them added from the other select element. In that case how do I keep the all the values in the hidden feild

Meena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top