[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.3

ASP Form - Validation - Blank Submission

Asked by CSS_Guy in Active Server Pages (ASP), Hypertext Markup Language (HTML)

Tags: ASP

Hi,

A client of mine has a form on their server that continuously gets blank form submissions. The information that is filled out simply gets emailed to a few email addresses.

I'm assuming a workaround for this would be server-side validation that requires that an actual character (not just spaces) be inputted into the form.

I have browsed the internet and followed a variety of tutorials without any success. I'm a PHP guy and don't have a ton of ASP experience.

I would prefer if you can send me some working code from a previous project as opposed to a link to a tutorial.

I really appreciate your help.

here's the form on their site: http://www.orasure.com/contact/contact-request-image.asp
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
/* heres the html */
 
<form method="post" action="form-process-image-request.asp" name="myform">
            <div class="contactwrap">
            <table class="contactable">
            <tr>
            <td><strong>First Name:</strong> <span class="highlight">*</span></td>
            <td><input type="text" size="38" name="FirstName" /></td>
            </tr>
            
            <tr>
            <td><strong>Last Name:</strong> <span class="highlight">*</span></td>
            <td><input type="text" size="38" name="LastName" /></td>
            </tr>
            
            <tr>
            <td><strong>Title:</strong></td>
            <td><input type="text" size="38" name="Title" /></td>
            </tr>
            
            <tr>
            <td><strong>Company:</strong> <span class="highlight">*</span></td>
            <td><input type="text" size="38" name="Company" /></td>
            </tr>
            
            <tr>
            <td><strong>Address:</strong></td>
            <td><input type="text" size="38" name="Location" /></td>
            </tr>
            
            <tr>
            <td><strong>Email:</strong> <span class="highlight">*</span></td>
            <td><input type="text" size="38" name="Email" /></td>
            </tr>
            
            <tr>
            <td><strong>Phone:</strong> <span class="highlight">*</span></td>
            <td><input type="text" size="38" name="Phone"  /></td>
            </tr>
            </table>
			</div><!-- end contactwrap -->
 
 
            
            <div class="contactwrap">
            <table class="contactable">
            <tr>
            <td colspan="2"><strong>I'm requesting the following product images (select all that apply)</strong><br /><br /></td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="OraQuickADVANCE" value="OraQuick ADVANCE Rapid HIV-1/2 Antibody Test"  class="iebrdr"/></td>
            <td>OraQuick ADVANCE&reg; Rapid HIV-1/2 Antibody Test</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="OraSureOralSpecimen" value="OraSure HIV-1 Oral Specimen Collection Device"  class="iebrdr"/></td>
            <td>OraSure&reg; HIV-1 Oral Specimen Collection Device</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="OraSureWesternBlot" value="OraSure HIV-1 Western Blot Kit"  class="iebrdr"/></td>
            <td>OraSure&reg; HIV-1 Western Blot Kit</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="InterceptOralFluid" value="Intercept Oral Fluid Drug Test"  class="iebrdr"/></td>
            <td>Intercept&reg; Oral Fluid Drug Test</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="QEDSalivaAlcohol" value="Q.E.D. Saliva Alcohol Test"  class="iebrdr"/></td>
            <td>Q.E.D.&reg; Saliva Alcohol Test</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="HistoFreezer" value="Histofreezer Portable Cryosurgical System"  class="iebrdr"/></td>
            <td>Histofreezer&reg; Portable Cryosurgical System</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="MICROPLATEForensic" value="MICRO-PLATE EIA &amp; AUTO-LYTE Technology for Forensic Toxicology"  class="iebrdr"/></td>
            <td>MICRO-PLATE EIA &amp; AUTO-LYTE&reg; Technology for Forensic Toxicology</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="FreezenClear" value="Freeze 'n Clear Skin Clinic Advanced Wart Remover"  class="iebrdr"/></td>
            <td>Freeze 'n Clear Skin Clinic&#153; Advanced Wart Remover</td>
            </tr>
			
            <tr>
            <td colspan="2"><br /><br /></td>
            </tr>
			
            <tr>
            <td colspan="2"><strong>In the following formats (select all that apply)</strong><br /><br /></td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="lowresgif" value="Low Resolution - GIF"  class="iebrdr"/></td>
            <td>Low Resolution - GIF</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="lowresjpg" value="Low Resolution - JPEG"  class="iebrdr"/></td>
            <td>Low Resolution - JPEG</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="hiresjpg" value="High Resolution - JPEG"  class="iebrdr"/></td>
            <td>High Resolution - JPEG</td>
            </tr>
            
            <tr>
            <td><input type="checkbox" name="hirespng" value="High Resolution - PNG"  class="iebrdr"/></td>
            <td>High Resolution - PNG</td>
            </tr>
            </table>
			</div><!-- end contactwrap -->
            
            
            
            <div class="contactwrap">
            <table class="contactable">
            
            <tr>
            <td><strong>Intended Purpose:</strong> <span class="highlight">*</span></td>
            <td><input type="text" size="38" name="Purpose"  /></td>
            </tr>
            </table>
            </div><!-- end contactwrap -->
 
			<input type="text" id="email_address" name="email_address" class="emailaddress" />
            <input type="image" src="http://www.orasure.com/i/img_btn_submit.jpg" border="0" alt="Submit" id="contactsubmit" onClick="return validate_form( );"/>
            </form>
 
 
 
 
 
 
/* heres the ASP */
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
 
 
<%
 
Dim spambot
 
spambot = Request.Form("email_address")
 
 
IF spambot = "" THEN
 
 
Set objMail = Server.CreateObject("CDO.Message")
 
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
 
 
objMail.From = "me@myserver.com" ' change this to an email address
objMail.To = "me@myserver.com" ' change this to your email address
objMail.Subject = "OraSure.com - Product Image Request" ' change this to your subject
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain) 
 
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain) 
objMail.HTMLBody = "<font size=3 face=verdana>"
objMail.HTMLBody = objMail.HTMLBody & Replace(Request.Form("Details"), vbCrLf, "<br />")  & "<br>" & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "First Name: "  & "</strong>" & Request.form("FirstName") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Last Name: "  & "</strong>" & Request.form("LastName") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Title: "  & "</strong>" & Request.form("Title") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Company: "  & "</strong>" & Request.form("Company") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Address: "  & "</strong>" & Request.form("Location") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Email: "  & "</strong>" & Request.form("Email") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Phone: "  & "</strong>" & Request.form("Phone") & "<br>" & "<br>" & "<br>"
 
 
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "I'm requesting the following product images: "  & "</strong>" & "<br>" & Request.form("OraQuickADVANCE") & "<br>" & Request.form("OraSureOralSpecimen") & "<br>" & Request.form("OraSureWesternBlot") & "<br>" & Request.form("InterceptOralFluid") & "<br>" & Request.form("QEDSalivaAlcohol") & "<br>" & Request.form("HistoFreezer") & "<br>" & Request.form("MICROPLATEForensic") & "<br>" & Request.form("FreezenClear") & "<br>" & "<br>" & "<br>"
 
 
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "In the following formats: " & "</strong>" & "<br>" & Request.form("lowresgif") & "<br>" & Request.form("lowresjpg") & "<br>" & Request.form("hiresjpg") & "<br>" & Request.form("hirespng") & "<br>" & "<br>" & "<br>" 
 
 
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Intended Purpose: " & "</strong>" & "<br>" & Request.form("Purpose") & "<br>" & "<br>" & "<br>" 
 
 
objMail.HTMLBody = objMail.HTMLBody & "<br>" & "<br>" & "Sent at " & Now() & "</font>"
 
objMail.Send()
 
Set objMail = Nothing
 
ELSE
   
Response.write("SPAM")
   
END IF
 
%>
[+][-]10/30/09 11:27 AM, ID: 25705622Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/30/09 10:38 PM, ID: 25708622Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Active Server Pages (ASP), Hypertext Markup Language (HTML)
Tags: ASP
Sign Up Now!
Solution Provided By: carrzkiss
Participating Experts: 2
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625