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

Option Menu

Status
Not open for further replies.

Phudsen

Technical User
Mar 7, 2003
136
A2
Hello everyone,

I am blocked here, I tried everything I know. Please help.

I have created form with option menu (Drop Down Box) to search a Database Results. The Drop Down Box is working properly, but the drop down is sending one value, how can I force the drop down box to send two values.

First value is the Choice
Second value is the value of the option

If it is not possible this way. Can I pass two values if I populate the Drop Down Box from the Database?

Any help will be appreciated.

Paulin
 
<SELECT id=&quot;MySelection&quot;>
<OPTION value=1 myvalue=2>OPTION 1</OPTION>
<OPTION value=2 myvalue=3>OPTION 2</OPTION>
</SELECT>

I am not sure that I am understanding you correctly but you can add as many values of sort to a drop down list as you would like.... or are you looking for a multi-select drop down list... where you are selecting more than one item?
 
Hi,

I appreciate your reply.

What I meant is passwing two parameters from the Option button. I don't mean multiselect option button. The Option button has a value. In addition to it I would like to pass another value to the results page.

The Drop Down will be in a form, is it possible to have a hidden field with another value and pass both values to the results page?

Thanks
Paulin
 
I'm a bit confused as to what you're asking too (and I'm currently searching for a better solution to a similar problem), but how about:

How about you write the &quot;value&quot; option as a string containing the different parameters you want, split by a colon?

<option value='235:555'>Option1</option>
<option value='322:300'>Option2</option>

Then in your javascript or whatever, you can use the trim function to get the appropriate values out the string.

Also, am not sure what you mean about &quot;Choice&quot;? Do you mean that if they select the second option, Choice is 2?
If so you can use the SelectedIndex property of the select box to get this, again via Javascript.

Hope this either helps or doesn't confuse.

graeme
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top