cjc1055
05-05-2005, 10:22 AM
I am new to validation. I have never done it before so any help would be appreciated. I am using classic ASP with ASPmail as the email client. Below is a link to my code... thanks in advance! the first half of the code is in below, and the second half is in the post below it....
<%
strHost = "mail.server.com"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strHost
Mail.From = "email@addres.com"
Mail.FromName = "from"
Mail.AddAddress "email@address.com", "name"
Mail.Subject = Request("Subject")
Mail.Body = "How did you hear about us: " &Request("hear") &chr(13) & chr(10) &"Who is your Team manager: " &Request ("manager") &chr(13) & chr(10) &"Who is your account executive: " &Request ("executive") &chr(13) & chr(10) &"What is your first name: " &Request ("first") &chr(13) & chr(10) &"What is your middle initial: " &Request ("middle") &chr(13) & chr(10) &"What is your last name: " &Request ("last") &chr(13) & chr(10) &"Suffix: " &Request ("suffix") &chr(13) & chr(10) &"Address: " &Request ("address") &chr(13) & chr(10) &"City: " &Request ("city") &chr(13) & chr(10) &"State: " &Request ("state") &chr(13) & chr(10) &"Zip Code: " &Request ("zip") &chr(13) & chr(10) &"Email Address: " &Request ("email") &chr(13) & chr(10) &"Password: " &Request ("password") &chr(13) & chr(10) &"Web Address: " &Request ("web") &chr(13) & chr(10) &"Business Phone: " &Request ("business") &chr(13) & chr(10) &"Mobile Phone: " &Request ("mobile") &chr(13) & chr(10) &"Home Phone: " &Request ("home") &chr(13) & chr(10) &"Fax Number: " &Request ("fax") &chr(13) & chr(10) &"Social Security Number: " &Request ("ssn") &chr(13) & chr(10) &"Best Phone to be reached: " &Request ("whichphone") &chr(13) & chr(10) &"Best Time to be Reached: " &Request ("besttime") &chr(13) & chr(10) &"Company Name: " &Request ("company") &chr(13) & chr(10) &"Owners Name: " &Request ("owner") &chr(13) & chr(10) &"Broker of Record: " &Request ("broker") &chr(13) & chr(10) &"Company Address: " &Request ("companyaddress") &chr(13) & chr(10) &"Company City: " &Request ("companycity") &chr(13) & chr(10) &"Company State: " &Request ("companystate") &chr(13) & chr(10) &"Company Zip Code: " &Request ("companyzip") &chr(13) & chr(10) &"Office Phone: " &Request ("companyofficephone") &chr(13) & chr(10) &"Office Fax: " &Request ("companyfax") &chr(13) & chr(10) &"Company Website Address: " &Request ("companyweb") &chr(13) & chr(10) &"Licensed Realtor Since: " &Request ("realtorsince") &chr(13) & chr(10) &"Years of experience as realtor: " &Request ("experience") &chr(13) & chr(10) &"FL Real estate lic #: " &Request ("realestatenumber") &chr(13) & chr(10) &"MLS ID #: " &Request ("mlsid") &chr(13) & chr(10) &"Houses sold per month: " &Request ("averagesales") &chr(13) & chr(10) &"Average Price of homes sold: " &Request ("averageprice") &chr(13) & chr(10) &"Type of mortgages (clients): " &Request ("mortgagetypes") &chr(13) & chr(10) &"Currently a broker: " &Request ("currentlymtgbroker") &chr(13) & chr(10) &"Mortgage Broker Since: " &Request ("mtgbrokersince") &chr(13) & chr(10) &"Years experience as Mtg Broker: " &Request ("experiencebroker") &chr(13) & chr(10) &"Fl Mtg Broker License #: " &Request ("brokernumber") &chr(13) & chr(10) &"What state is license held: " &Request ("licensestate") &chr(13) & chr(10) &"License with lender?: " &Request ("licenselender") &chr(13) & chr(10) &"Average amount of loans: " &Request ("amountofloan") &chr(13) & chr(10) &"Avg Amt of loans per month: " &Request ("loansclosed") &chr(13) & chr(10) &"Other Licenses: " &Request ("otherlicenses") &chr(13) & chr(10) &"Ref. 1 Name: " &Request ("ref1name") &chr(13) & chr(10) &"Ref. 1 Company: " &Request ("ref1company") &chr(13) & chr(10) &"Ref. 1 Phone: " &Request ("ref1phone") &chr(13) & chr(10) &"Ref 1 Time Known: " &Request ("ref1time") &chr(13) & chr(10) &"Ref. 2 Name: " &Request ("ref2name") &chr(13) & chr(10) &"Ref. 2 Company: " &Request ("ref2company") &chr(13) & chr(10) &"Ref. 2 Phone: " &Request ("ref2phone") &chr(13) & chr(10) &"Ref 2 Time Known: " &Request ("ref2time") &chr(13) & chr(10) &"Ref. 3 Name: " &Request ("ref3name") &chr(13) & chr(10) &"Ref. 3 Company: " &Request ("ref3company") &chr(13) & chr(10) &"Ref. 3 Phone: " &Request ("ref3phone") &chr(13) & chr(10) &"Ref 3 Time Known: " &Request ("ref3time") &chr(13) & chr(10) &"Questions Comments: " &Request ("comments") &chr(13) & chr(10) &"Felony or misdemeanor?: " &Request ("1a") &chr(13) & chr(10) &"Any Felony?: " &Request ("1b") &chr(13) & chr(10) &"subject of investigation?: " &Request ("2") &chr(13) & chr(10) &"Understands Disclosure: " &Request ("disclosure") &chr(13) & chr(10) &"Information on coverages (on=yes) (blank=no): " &Request ("coverage") &chr(13) & chr(10) &"Wants secure link services (on=yes) (blank=no): " &Request ("link") &chr(13) & chr(10) &"Wants to upgrade personal webpage (on=yes) (blank=no): " &Request ("upgrade")
strErr = ""
bSuccess = False
On Error Resume Next
Mail.Send
If Err <> 0 Then
strErr = Err.Description
else
bSuccess = True
Response.redirect("http://www.site.com/thankyou.htm")
End If
End If
%>
<HTML>
<BODY BGCOLOR="#76816A">
<% If strErr <> "" Then %>
<h3>Error occurred: <% = strErr %>
<% End If %>
<% If bSuccess Then %>
Thank you!
<% End If %>
<center><h1>Loan Originator Employment Application</h1></center>
<center><h4>Welcome to the secure online Employment Application. Once you submit your application it will receive immediate attention from one of our representatives.</h4> </center>
<FORM METHOD="POST" ACTION="empapp.asp">
<center>
<br>
<hr>
<h3>General Information</h3> <br>
How did you hear about us? <input name="hear" type="text" size="30" maxlength="30"> <br>
Who is your Team Manager? <input name="manager" type="text" size="30" maxlength="30"> <br>
Who is your Account Executive <input name="executive" type="text" size="30" maxlength="30"> <br> <br> <br>
<hr>
<h3>Personal Information</h3> <br>
First Name <input name="first" type="text" size="30" maxlength="30"> <br>
Middle Initial <input name="middle" type="text" size="1" maxlength="1"> <br>
Last Name <input name="last" type="text" size="30" maxlength="30"> <br>
Suffix
<SELECT NAME="suffix">
<OPTION SELECTED>
<OPTION>Jr.
<OPTION>Sr.
<OPTION>II
<OPTION>III
<OPTION>IV
</SELECT> <br> <br>
Address <input name="address" type="text" size="30" maxlength="30"> <br>
City <input name="City" type="text" size="30" maxlength="30"> <br>
State <input name="State" type="text" size="2" maxlength="2"> <br>
Zip Code <input name="zip" type="text" size="30" maxlength="30"> <br>
Email Address <input name="email" type="text" size="30" maxlength="30"> <br>
Your Selected Password <input name="password" type="password" size="30" maxlength="30"> <br>
Personal Website Address <input name="web" type="text" size="30" maxlength="30"> <br>
Business Phone <input name="business" type="text" size="30" maxlength="30"> <br>
Mobile Phone <input name="mobile" type="text" size="30" maxlength="30"> <br>
Home Phone <input name="home" type="text" size="30" maxlength="30"> <br>
Personal Fax <input name="fax" type="text" size="30" maxlength="30"> <br>
Social Security Number <input name="ssn" type="password" size="30" maxlength="30"> <br>
Which Phone is the best to reach you?
<SELECT NAME="whichphone">
<OPTION SELECTED>Business
<OPTION>Mobile/Other
<OPTION>Home
<OPTION>Email
</SELECT> <br>
the rest of the code is down below in the next post...
<%
strHost = "mail.server.com"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strHost
Mail.From = "email@addres.com"
Mail.FromName = "from"
Mail.AddAddress "email@address.com", "name"
Mail.Subject = Request("Subject")
Mail.Body = "How did you hear about us: " &Request("hear") &chr(13) & chr(10) &"Who is your Team manager: " &Request ("manager") &chr(13) & chr(10) &"Who is your account executive: " &Request ("executive") &chr(13) & chr(10) &"What is your first name: " &Request ("first") &chr(13) & chr(10) &"What is your middle initial: " &Request ("middle") &chr(13) & chr(10) &"What is your last name: " &Request ("last") &chr(13) & chr(10) &"Suffix: " &Request ("suffix") &chr(13) & chr(10) &"Address: " &Request ("address") &chr(13) & chr(10) &"City: " &Request ("city") &chr(13) & chr(10) &"State: " &Request ("state") &chr(13) & chr(10) &"Zip Code: " &Request ("zip") &chr(13) & chr(10) &"Email Address: " &Request ("email") &chr(13) & chr(10) &"Password: " &Request ("password") &chr(13) & chr(10) &"Web Address: " &Request ("web") &chr(13) & chr(10) &"Business Phone: " &Request ("business") &chr(13) & chr(10) &"Mobile Phone: " &Request ("mobile") &chr(13) & chr(10) &"Home Phone: " &Request ("home") &chr(13) & chr(10) &"Fax Number: " &Request ("fax") &chr(13) & chr(10) &"Social Security Number: " &Request ("ssn") &chr(13) & chr(10) &"Best Phone to be reached: " &Request ("whichphone") &chr(13) & chr(10) &"Best Time to be Reached: " &Request ("besttime") &chr(13) & chr(10) &"Company Name: " &Request ("company") &chr(13) & chr(10) &"Owners Name: " &Request ("owner") &chr(13) & chr(10) &"Broker of Record: " &Request ("broker") &chr(13) & chr(10) &"Company Address: " &Request ("companyaddress") &chr(13) & chr(10) &"Company City: " &Request ("companycity") &chr(13) & chr(10) &"Company State: " &Request ("companystate") &chr(13) & chr(10) &"Company Zip Code: " &Request ("companyzip") &chr(13) & chr(10) &"Office Phone: " &Request ("companyofficephone") &chr(13) & chr(10) &"Office Fax: " &Request ("companyfax") &chr(13) & chr(10) &"Company Website Address: " &Request ("companyweb") &chr(13) & chr(10) &"Licensed Realtor Since: " &Request ("realtorsince") &chr(13) & chr(10) &"Years of experience as realtor: " &Request ("experience") &chr(13) & chr(10) &"FL Real estate lic #: " &Request ("realestatenumber") &chr(13) & chr(10) &"MLS ID #: " &Request ("mlsid") &chr(13) & chr(10) &"Houses sold per month: " &Request ("averagesales") &chr(13) & chr(10) &"Average Price of homes sold: " &Request ("averageprice") &chr(13) & chr(10) &"Type of mortgages (clients): " &Request ("mortgagetypes") &chr(13) & chr(10) &"Currently a broker: " &Request ("currentlymtgbroker") &chr(13) & chr(10) &"Mortgage Broker Since: " &Request ("mtgbrokersince") &chr(13) & chr(10) &"Years experience as Mtg Broker: " &Request ("experiencebroker") &chr(13) & chr(10) &"Fl Mtg Broker License #: " &Request ("brokernumber") &chr(13) & chr(10) &"What state is license held: " &Request ("licensestate") &chr(13) & chr(10) &"License with lender?: " &Request ("licenselender") &chr(13) & chr(10) &"Average amount of loans: " &Request ("amountofloan") &chr(13) & chr(10) &"Avg Amt of loans per month: " &Request ("loansclosed") &chr(13) & chr(10) &"Other Licenses: " &Request ("otherlicenses") &chr(13) & chr(10) &"Ref. 1 Name: " &Request ("ref1name") &chr(13) & chr(10) &"Ref. 1 Company: " &Request ("ref1company") &chr(13) & chr(10) &"Ref. 1 Phone: " &Request ("ref1phone") &chr(13) & chr(10) &"Ref 1 Time Known: " &Request ("ref1time") &chr(13) & chr(10) &"Ref. 2 Name: " &Request ("ref2name") &chr(13) & chr(10) &"Ref. 2 Company: " &Request ("ref2company") &chr(13) & chr(10) &"Ref. 2 Phone: " &Request ("ref2phone") &chr(13) & chr(10) &"Ref 2 Time Known: " &Request ("ref2time") &chr(13) & chr(10) &"Ref. 3 Name: " &Request ("ref3name") &chr(13) & chr(10) &"Ref. 3 Company: " &Request ("ref3company") &chr(13) & chr(10) &"Ref. 3 Phone: " &Request ("ref3phone") &chr(13) & chr(10) &"Ref 3 Time Known: " &Request ("ref3time") &chr(13) & chr(10) &"Questions Comments: " &Request ("comments") &chr(13) & chr(10) &"Felony or misdemeanor?: " &Request ("1a") &chr(13) & chr(10) &"Any Felony?: " &Request ("1b") &chr(13) & chr(10) &"subject of investigation?: " &Request ("2") &chr(13) & chr(10) &"Understands Disclosure: " &Request ("disclosure") &chr(13) & chr(10) &"Information on coverages (on=yes) (blank=no): " &Request ("coverage") &chr(13) & chr(10) &"Wants secure link services (on=yes) (blank=no): " &Request ("link") &chr(13) & chr(10) &"Wants to upgrade personal webpage (on=yes) (blank=no): " &Request ("upgrade")
strErr = ""
bSuccess = False
On Error Resume Next
Mail.Send
If Err <> 0 Then
strErr = Err.Description
else
bSuccess = True
Response.redirect("http://www.site.com/thankyou.htm")
End If
End If
%>
<HTML>
<BODY BGCOLOR="#76816A">
<% If strErr <> "" Then %>
<h3>Error occurred: <% = strErr %>
<% End If %>
<% If bSuccess Then %>
Thank you!
<% End If %>
<center><h1>Loan Originator Employment Application</h1></center>
<center><h4>Welcome to the secure online Employment Application. Once you submit your application it will receive immediate attention from one of our representatives.</h4> </center>
<FORM METHOD="POST" ACTION="empapp.asp">
<center>
<br>
<hr>
<h3>General Information</h3> <br>
How did you hear about us? <input name="hear" type="text" size="30" maxlength="30"> <br>
Who is your Team Manager? <input name="manager" type="text" size="30" maxlength="30"> <br>
Who is your Account Executive <input name="executive" type="text" size="30" maxlength="30"> <br> <br> <br>
<hr>
<h3>Personal Information</h3> <br>
First Name <input name="first" type="text" size="30" maxlength="30"> <br>
Middle Initial <input name="middle" type="text" size="1" maxlength="1"> <br>
Last Name <input name="last" type="text" size="30" maxlength="30"> <br>
Suffix
<SELECT NAME="suffix">
<OPTION SELECTED>
<OPTION>Jr.
<OPTION>Sr.
<OPTION>II
<OPTION>III
<OPTION>IV
</SELECT> <br> <br>
Address <input name="address" type="text" size="30" maxlength="30"> <br>
City <input name="City" type="text" size="30" maxlength="30"> <br>
State <input name="State" type="text" size="2" maxlength="2"> <br>
Zip Code <input name="zip" type="text" size="30" maxlength="30"> <br>
Email Address <input name="email" type="text" size="30" maxlength="30"> <br>
Your Selected Password <input name="password" type="password" size="30" maxlength="30"> <br>
Personal Website Address <input name="web" type="text" size="30" maxlength="30"> <br>
Business Phone <input name="business" type="text" size="30" maxlength="30"> <br>
Mobile Phone <input name="mobile" type="text" size="30" maxlength="30"> <br>
Home Phone <input name="home" type="text" size="30" maxlength="30"> <br>
Personal Fax <input name="fax" type="text" size="30" maxlength="30"> <br>
Social Security Number <input name="ssn" type="password" size="30" maxlength="30"> <br>
Which Phone is the best to reach you?
<SELECT NAME="whichphone">
<OPTION SELECTED>Business
<OPTION>Mobile/Other
<OPTION>Home
<OPTION>Email
</SELECT> <br>
the rest of the code is down below in the next post...