Confirming Email addresss and moving to sending email

P

PJ

I'm creating a form. This form will pull information from a database
for the customer to see. If the customer confirm that the above
information is correct and would like to apply for payment plan they
must enter there phone number and email address. I'm having the
customer also enter a confirm email address, this is were the problems
starts.

Ok I call the "Email Address" "Email1" and the "Confirm Email Address"
Email2.
First I compare the two emails with and onSubmit. Than I want to move
to forward the email and move to next form. The next form is a
confirmation form.
I can email and move to confirmation for if I don't compare the two
emails.
Here what I've got so far.

<script language="javascript" type="text/javascript">

function Compare(Email1, Email2)
{
if (Email1 != Email2)
{
alert("Your Email Address and Confirm Email Address must be the
same.");
return false;
}
else
{
return true;
}
}
</script>
<meta name="Microsoft Border" content="tl, default">
</head>
<script language="javascript">
onSubmit="Compare (Email1, Email2);"
</script>
---Now I'm need to move to the second part of the Submit. Here's my
code.
It doesn't give the error message if the email don't match and it
doesn't move to the next set of comands. I'm sorry I'm really new at
this stuff. This is my first attempt. I've never written any code at
all.


<% if Request("return") = "true" then

dim mailobject
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.To = Request("Email1")
MailObject.From = "(e-mail address removed)"
MailObject.Subject = "Applications for Payment Plan"
strbody= "Owner: "
strbody = strbody & owner
strbody= strbody & vbcrlf &"Location: "
strbody = strbody & full_location
strbody= strbody & vbcrlf &"Mailing Address: "
strbody = strbody & address1
if not isnull(address2) then
strbody = strbody & vbcrlf &address2
end if
if not isnull(address3) then
strbody = strbody & vbcrlf &address3
end if
if not isnull(address4) then
strbody = strbody & vbcrlf &address4
end if
if not isnull(city) then
strbody = strbody & vbcrlf &city
end if
if not isnull(state) then
strbody = strbody & vbcrlf &state
end if
if not isnull(zip) then
strbody = strbody & vbcrlf &zip
end if
strbody= strbody & vbcrlf &"Acct Number: "
strbody = strbody & acctnumber
strbody= strbody & vbcrlf &"ID: "
strbody = strbody & pmid
strbody= strbody & vbcrlf &"Application Code: "
strbody = strbody & app_code
strbody= strbody & vbcrlf &"Legal Description: "
strbody = strbody & short_legal_description &vbcrlf
strbody= strbody & vbcrlf &"Email Address: "
strbody = strbody & Request("Email1")
strbody= strbody & vbcrlf &"Email Address Confirmed: "
strbody = strbody & Request("Email2")
strbody= strbody & vbcrlf &"Home Phone Number: "
strbody = strbody & ")"
strbody = strbody & Request("phone")
strbody = strbody & ")"
strbody = strbody & Request("phone1")
strbody = strbody & "-"
strbody = strbody & Request("phone2")
strbody= strbody & vbcrlf &"Confirmation Number (Please keep this
number for your records): "
strbody = strbody & confnum
MailObject.Body = strbody
MailObject.CC = "(e-mail address removed)"
MailObject.Send
Set MailObject = Nothing
response.clear
strRedirectURL = "confirmation.asp"
response.redirect strRedirectURL
response.end
end if

Session("owner")= owner
Session("full_location") = full_location
Session("address1")= address1
Session("address2")= address2
Session("address3")= address3
Session("address4") = address4
Session("city")= city
Session("state")= state
Session("zip")= zip
Session("acctumber")= acctnumber
Session("pmid")= pmid
Session("app_code")=app_code
Session("short_legal_description") =short_legal_description
Session("confnum") = confnum
Session("DestPage")="confirmation.asp"
%>

Thank you for your help. I just can't get it to compare the email
address and move to the sending email and moving information to
confirmation page. Like I said if I don't compare the address and
just do the email and send to confimation page that part works. My
problem has to be in the camparing email address and than moving to
the next process.
 
K

Kevin

Are you working with ASP pages? If so, I am not sure how
much of what I am going to suggest will help, but in a
normasl Access form, I would check the eMail addresses
were the same using the Before Update Event for the second
E-mail address. I would have something like the following:

if(email1=email2)then
do whatever you'd normally do if they were the same.
elseif(email<>email2) then
msgbox "The two email address must be equal for you to
proceed"
me!email2=""
me!email2.setfocus
end if

Doing it this way would prevent them from having to
navigate back to this form.

I hope that helps!

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top