ASP if then text value

M

Mettá

my brain is no longer werkings...

I am trying to set a form to email to a potential limited number of people
with something like

<%If x=1 Then eml2="[email protected]" End If%>
<%If x=2 Then eml2="[email protected]" End If%>
<%If x=3 Then eml2="[email protected]" End If%>

x is based on a form selection in a previous page. The email must not show
up, they will be used in a CDO mail so will not show up in the html. (To
stop harvesters)

So how do I get "eml2" to accept the text value?

Thanks
M
 
K

Kevin Spencer

eml2 = Request.Form("WhateverTheHeckTheFormFieldNameIs")

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
 
M

Mettá

Sorry maybe I was not clear. The email address is not in the form.

Lets say I have 4 members of staff and people might contact any one of them
via a form. Now to protect the email address it is hidden and the form
content will be sent via CDO to any one of 3 email addresses.

So...
How can I get eml2 =variable depending on the value of "x" which is selected
on the form?

Thanks
M
 
M

MikeR

Metta -
The most likely reason is the x is not a 1 or 2 or 3.
Try displaying (with a response.write and response .end to halt execution) x and
see what it is. You can put it all in one script block like
MikeR

<%
If x=1 Then
eml2="[email protected]"
End If
If x=2 Then
eml2="[email protected]"
End If
If x=3 Then
eml2="[email protected]"
End If
response.write "X = " & x & " eml2 = " & eml2
response.end
%>
 
M

Mettá

Thanks Mike
I was creating a mess, now solved.


MikeR said:
Metta -
The most likely reason is the x is not a 1 or 2 or 3.
Try displaying (with a response.write and response .end to halt execution)
x and see what it is. You can put it all in one script block like
MikeR

<%
If x=1 Then
eml2="[email protected]"
End If
If x=2 Then
eml2="[email protected]"
End If
If x=3 Then
eml2="[email protected]"
End If
response.write "X = " & x & " eml2 = " & eml2
response.end
%>
 
Top