View Single Post
  #3 (permalink)  
Old March 15th, 2009, 06:29 PM
mat41 mat41 is offline
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

A very strange requirement, i cant imagine why you would wany the text value also. Shouldnt your select list be created from a DB table, all your should need is the ID, then you would get the string based on that ID from the table.......

Not that I have done this before but I can see a much less complicated way. There is no need to store all your values in an array - Im mean after all you only want the two values that are being selected correct? This is a bit of a hack but much much less code than whats been suggested.

Place both values inside the value="" seperated by a comer like so

<select name="checkDropDown" onchange="elements['TextwithList'].value = this.text">
<option value="1,ashok">ashok</option>
<option value="2,amit">amit</option>
<option value="3,Sunil">Sunil</Option>
</select>

Now your trim(request.form("checkDropDown")) will return:

1,ashok

if the first option is selected. Now use the Split function, split on the commer and there are your two values. As I said a hack but a simple one that will work for you. Sure you may have to alter your onChange code but that should be strait forward.
__________________
Wind is your friend
Matt
Reply With Quote
The Following User Says Thank You to mat41 For This Useful Post:
beetle_jaipur (March 28th, 2009)