Passing parameters to another page?

Hello,

I have a .jsp form with a drop-down box like this:

<select name=newlist>

<option value=1>Title 1

<option value=2>Title 2

<option value=3>Title 3

<option value=4>Title 4

</select>

When I submit the form, I retrieve the value like this:

int jlistvalue = Integer.parseInt(request.getParameter("newlist"));

Is there a way to also retrieve the title?

Your help is greatly appreciated.

Logan

[507 byte] By [loganscotta] at [2007-10-2 17:19:36]
# 1
Yes. <option value="Title 1">Title 1
CeciNEstPasUnProgrammeura at 2007-7-13 18:35:33 > top of Java-index,Java Essentials,Java Programming...
# 2
What you get back from a select is whatever you put in the value attribute (as a string). The client doesn't send the displayed value.But then, your server should know what was in the list and be able to look it up; after all the server generated it in the first place.
malcolmmca at 2007-7-13 18:35:33 > top of Java-index,Java Essentials,Java Programming...
# 3
Thank you for helping.What I would like to do is pass both the value and the title in a way that does not require me to query the database for the title.Any suggestions on a good way to do this?
loganscotta at 2007-7-13 18:35:33 > top of Java-index,Java Essentials,Java Programming...
# 4
A good way to do it? There are none. There are ways to do it, though. For example:<option value="1:Title 1">Title 1</option>
DrClapa at 2007-7-13 18:35:33 > top of Java-index,Java Essentials,Java Programming...
# 5
Is this a method you would use to avoid additional trips to the database?Thank you again.
loganscotta at 2007-7-13 18:35:33 > top of Java-index,Java Essentials,Java Programming...