Forum Moderators: open

Message Too Old, No Replies

Compare two email addresses?

         

Headed North

5:52 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



I'm setting up a form that has the user reenter their email address a second time. What expression can I use to compare the two email addresses to see if they are the same? The field names are BILLING_EMAIL and BILLING_EMAIL2

mattglet

6:04 pm on Jan 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if not (Request.Form("BILLING_EMAIL") = Request.Form("BILLING_EMAIL2")) then
'--- Handle error
end if

Headed North

6:19 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



Doesn't seem to work. Can two text strings be compared or do I need to use any kind of conversion on the data?

Headed North

6:57 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



I figured it out. Just used:

If htmlEncode(BILLING_EMAIL) <> htmlEncode(BILLING_EMAIL2) Then

' Error Display

End If

Thanks.

Easy_Coder

8:08 pm on Jan 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sometimes StrComp is an option too...

e = Trim(LCase(Request.Form("BILLING_EMAIL")))
f = Trim(LCase(Request.Form("BILLING_EMAIL2")))

if StrComp(e,f) <> 0 then
'--- Handle error
end if

Headed North

8:11 pm on Jan 18, 2006 (gmt 0)

10+ Year Member



Excellent. Thanks Easy Coder. That will come in handy.