Click to See Complete Forum and Search --> : problem selecting a form option


munna
09-12-2003, 08:25 AM
Hi,
I have got a form with a set of options like this:

<select name="Target">
<option value="a@somewhere.com"> A.Name</option>
<option value="b@somewhere.com"> B.Name</option>
<option value="c@somewhere.com"> C.Name</option>
<option value="d@somewhere.com"> D.Name</option>
</select>

I'm using this at the moment to get the vlaue:
Email = Request.form("Target")

However, I would like to have another variable ("Name") which could store the actual name, rather than the e-mail address. So, while "Email" could store "a@somewhere.com", "Name" would store "A.Name".

Please could someone tell me how to do this?
--Munna

rdoekes
09-12-2003, 10:03 AM
how do you build this drop down box? Do you manually added these, or use a database?

munna
09-16-2003, 03:49 AM
No database, its just a simple form with the options hardcoded in.

rdoekes
09-16-2003, 10:41 AM
since you hardcoded these, you could also do a little hardcoding on the postback.

For instance a Dictionary Object

Set dNames = Server.CreateObject("Scripting.Dictionary")
dNames.Add "a@somewhere.com", "A.Name"
dNames.Add "b@somewhere.com", "B.Name"

Email = Request.Form("Target")
Name = dNames.Item(Email)
Set dNames = Nothing

-Rogier Doekes