Click to See Complete Forum and Search --> : need help with validation


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...

cjc1055
05-05-2005, 10:23 AM
and here is the rest of the code....




Best time to reach you?
<SELECT NAME="besttime">
<OPTION SELECTED>Anytime
<OPTION>Morning
<OPTION>Noon
<OPTION>Afternoon
<OPTION>Evening
</SELECT> <br> <br>
<hr>
I need information on Health Insurance, Workers Comp. Coverage, Dental, and Life Insurance. <input name="coverage" type="checkbox"> <br>
Would you like a secure link services from so that you may link to the Online Loan Application? <input name="link" type="checkbox"> <br>
Would you like to upgrade your personal website to a better website that integrates directly with shows your listings and allows you to create brochures? <input name="upgrade" type="checkbox"> <br>
<br>
<hr>
<h3>Company Information</h3> <br>
Your Company Name <input name="company" type="text" size="30" maxlength="30"> <br>
Owners Name <input name="owner" type="text" size="30" maxlength="30"> <br>
Broker of Record <input name="broker" type="text" size="30" maxlength="30"> <br>
Address <input name="companyaddress" type="text" size="30" maxlength="30"> <br>
City <input name="companycity" type="text" size="30" maxlength="30"> <br>
State <input name="companystate" type="text" size="2" maxlength="2"> <br>
Zip Code <input name="companyzip" type="text" size="10" maxlength="10"> <br>
Office Phone <input name="companyofficephone" type="text" size="11" maxlength="11"> <br>
Office Fax <input name="companyfax" type="text" size="11" maxlength="11"> <br>
Company Website Address <input name="companyweb" type="text" size="30" maxlength="30"> <br>
<br>
<br>
<hr>
<h3>Licensed Realtor Information</h3> <br>
Licensed Realtor Since (year) <input name="realtorsince" type="text" size="4" maxlength="4"> <br>
Years of experience as an active Realtor <input name="experience" type="text" size="3" maxlength="3"> <br>
Florida Real Estate License Number <input name="realestatenumber" type="text" size="20" maxlength="20"> <br>
MLS Salesperson ID number <input name="mlsid" type="text" size="20" maxlength="20"> <br>
As an average, how many houses do you sell per month? <input name="averagesales" type="text" size="3" maxlength="3"> <br>
What is the average price of the homes you sell? <input name="averageprice" type="text" size="10" maxlength="10"> <br>
What kind of mortgages do your clients generally require? <input name="mortgagetypes" type="text" size="20" maxlength="20"> <br>
<hr>
<h3>Licensed Mortgage Broker Information</h3> <br>
Are you currently working as a Mortgage Broker? <input name="currentlymtgbroker" type="text" size="10" maxlength="10"> <br>
Licensed Mortgage Broker since (Year) <input name="mtgbrokersince" type="text" size="4" maxlength="4"> <br>
Years of experience as an active Mortgage Broker <input name="experiencebroker" type="text" size="3" maxlength="3"> <br>
Florida Mortgage Broker License Number <input name="brokernumber" type="text" size="20" maxlength="20"> <br>
In what state is your license presently held? <input name="licensestate" type="text" size="15" maxlength="15"> <br>
Is your license currently with a Lender? If so, which lender? <input name="licenselender" type="text" size="30" maxlength="30"> <br>
What is the average amount of your loans? <input name="amountofloan" type="text" size="10" maxlength="10"> <br>
On average, how many Loans do you Close per month? <input name="loansclosed" type="text" size="3" maxlength="3"> <br>
<hr>
<h3>Other Professional Licenses</h3> <br>
Please let us know of any other designations, licenses or certificates you hold and any business experience you would like for to consider by entereing them below: <br>
<br>
<textarea name="otherlicenses" rows="4" id="otherlicenses" class="normaltext" style="width:60%;"> </textarea>
<br>
<hr>
<h3>Professional References</h3> <br>

1. Name: <input name="ref1name" type="text" size="30" maxlength="30"> <br>
Company: <input name="ref1company" type="text" size="30" maxlength="30"> <br>
Phone Number: <input name="ref1phone" type="text" size="30" maxlength="30"> <br>
How long have you known this person? <input name="ref1time" type="text" size="30" maxlength="30"> <br> <br>

2. Name: <input name="ref2name" type="text" size="30" maxlength="30"> <br>
Company: <input name="ref2company" type="text" size="30" maxlength="30"> <br>
Phone Number: <input name="ref2phone" type="text" size="30" maxlength="30"> <br>
How long have you known this person? <input name="ref2time" type="text" size="30" maxlength="30"> <br> <br>

3. Name: <input name="ref3name" type="text" size="30" maxlength="30"> <br>
Company: <input name="ref3company" type="text" size="30" maxlength="30"> <br>
Phone Number: <input name="ref3phone" type="text" size="30" maxlength="30"> <br>
How long have you known this person? <input name="ref3time" type="text" size="30" maxlength="30"> <br> <br>
<hr>
<h3>Questions or comments</h3> <br>

<textarea name="comments" rows="4" id="comments" class="normaltext" style="width:60%;"> </textarea> <br> <br>

<hr>
<h3>Background Verification</h3> <br>
Have you ever been convicted of, or plead guilty or nolo contendere ("no contest") to: <br>
1. a) A felony or misdemeanor involving insurance, investments, or a related business, fraud, breach of trust, false statements or omissions, wrongful taking of property, bribery, forgery, counterfeiting or extortion?
Yes <input name="1a" type="radio" value="yes"> No <input name="1a" type="radio" value="no"> <br> <br>
b) Any felony? Yes <input name="1b" type="radio" value="yes"> No <input name="1b" type="radio" value="no"><br> <br>

2. Are you now the subject of any complaint, investigation, or proceeding that could result in a "yes" answer to question #1 above?
Yes <input name="2" type="radio" value="yes"> No <input name="2" type="radio" value="no"> <br> <br>
<hr>
I am warranting that the information above is true and correct. By submitting this application I hereby authorize the background search to validate this information

Please read the following non-disclosure statement and acknowledge that you have read and understood it by checking the box immediately below the statement.<br>
<textarea name="non" readonly="readonly" rows="4" id="non" class="normaltext" style="width:60%;">
By submitting this employment application I covenant and warrant that I will not disclose the unique business concept of Direct which allows for the payment of the point of sale contact via the electronic transmission of loan applications or said information for any purpose without the express written consent of Direct. I will be responsible and fully liable for such disclosure as it pertains to harmful damage to the company. I understand that I will be trained and certified by Direct as Loan Originator and do agree to fully comply with the policies and procedures of the company and all compliance required of the lenders license. Finally, I acknowledge that the founder and creator of the system is the owner of Direct and that I had no contribution to the development of the program, the concept or business design, nor do I claim rights to or expect to benefit from the Direct business system except by express written agreement and I agree to fully execute all personnel documents should I be approved for employment. </textarea> <br>

I have Read and Agree to the Non-Disclosure Statement Above <input name="disclosure" type="checkbox"><br> <br>
<textarea name="proc" readonly="readonly" rows="4" id="proc" class="normaltext" style="width:60%;">
I understand that charges a new hire processing fee of $180.00 to cover the expense of human resource and payroll processing set-up fees, background search, personnel verification, website access set-up and passwords, and the new hire orientation/training. I hereby agree to pay the fee and authorize you to deduct this sum from the monies due at the time of the first closing. </textarea> <br>
Once submitted, your information is secure, protected and is not stored on this site<br>
<br>
<hr>
<br>
<TD COLSPAN=2><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Submit Form">
<TD COLSPAN=2><input type="RESET" name="reset" value="Reset">
<br>
<br>
</TD>
</TR>
</center>
</FORM>
</BODY>
</HTML>

phpnovice
05-05-2005, 11:26 AM
I am new to validation. I have never done it before so any help would be appreciated.
Howsabout a description of what you want to validate and how? ;)

cjc1055
05-05-2005, 11:46 AM
sorry :)

I want to have First name, last name, address, city, zip, state, email address(requiring a & and a .), password at least 4 charecters, business phone, home phone, and social security number, all of the professional references, (name, company, phone, how long have you know this person), the three radio buttons, and the non disclosure statement checkbox, all need to be validated.

Thanks for the quick response and I thank you for looking at this for me!

-Chris

cjc1055
05-05-2005, 03:14 PM
I've been working on this for hours and still can't figure it out... any suggestions?

wmif
05-05-2005, 03:20 PM
post what you have so far. no one is gonna write everything out for you.

cjc1055
05-05-2005, 03:24 PM
I'm really not asking anyone to write it for me.. I just need a starting point... I tried looking at other code to figure it out.. I'm just not getting it.. if someone could just give me a starting point to play with I could probably get it.

Thanks

phpnovice
05-05-2005, 07:19 PM
For starters... For ASP validation, you'll generally want to use a flow similar to the following:

<% @Language=VBScript %>
<% Option Explicit
'
' opening ASP code here
'
Dim inError, errMessage
errMessage = ""
inError = False
'
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
'
' validation and updating ASP code here
'
End If
'
If Not inError Then
'
' page initializing code here
'
End If
%>
<!DOCTYPE ... >
<HTML>
..etc...
<!--
somewhere in here you'll display any resulting error message
you might use code such as the following to insert ASP
variable content into your HTML:

<% If inError Then Response.Write errMessage %>
-->
..etc...
</HTML>
<%
'
' closing ASP code here
'
%>

cjc1055
05-05-2005, 09:04 PM
does anyone want to write a validation code into the code that i posted? how much $$ email me if interested cjc1055@yahoo.com

cjc1055
05-08-2005, 10:04 PM
Well I thought I was stuck here with no validation until I got an email from Dave Clark at www.DaveClarkConsulting.com and he not only created an awesome script for me, but he formatted my form correctly, and formatted the way the email looks when it is mailed to me. He made it perfect. If anyone needs any work done, i definately reccommend him.

Thanks Dave

phpnovice
05-08-2005, 11:04 PM
Yeah, I let him know that you were looking for some contracting help. I'm sure you could have gotten just as good of results from here but, at forum posting speeds, it would probably have taken at least a week in exchanges of instructive-type information -- instead of just a couple of days. ;)

Cheers.

cjc1055
05-09-2005, 07:14 AM
Yeah, thanks for letting him know about me. I was speachless after I opened up the script he wrote for me. I really couldn't believe he did such a good job and did so many things that I wasn't even expecting, and it looks much more professional now than I ever could have gotten it to look. All I can say is wow!

Thanks!