Hello ASP newb here, I'm trying to implement ww captcha on a one page form that has required fields. I am using ASPmail to send the mail. By experimenting with the code above I can get captcha to pass or fail the code but I can't get it to start my required feild validation and then if all passes send the email. You mention that version 4 supports one page use but I cannot find any KB article or instructions on how to implement it. Below is an edited version of my code any direction is greatly appriciated. Thank you,
<!-- Include file for CAPTCHA configuration -->
<!-- #include file="CAPTCHA/CAPTCHA_configuration.asp" -->
<!-- Include file for CAPTCHA form processing -->
<!-- #include file="CAPTCHA/CAPTCHA_process_form.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Contact Us</title>
edit code
<!-- include the Web Wiz CAPTCHA form element -->
<!--#include file="CAPTCHA/CAPTCHA_form_inc.asp" -->
<font size="2" face="arial,helvetica">
<input name="submit" type="submit" value="Submit">
</font></td>
</tr>
<font size="2" face="arial,helvetica">
<input type="hidden" name="Mode" value="Submit">
</font>
</form>
</table>
<font size="2" face="arial,helvetica"><BR>
<%
'If CAPTCHA is entered correctly run the following code
If Request("CAPTCHA_Postback") AND blnCAPTCHAcodeCorrect = True Then
Errors = False
If Request("Mode") = "Send" And Request("eMail") = "" Then Errors = True
Errors = False
If Request("Mode") = "Send" And Request("Name") = "" Then Errors = True
Errors = False
If Request("Mode") = "Send" And Request("City") = "" Then Errors = True
Errors = False
If Request("Mode") = "Send" And Request("State") = "" Then Errors = True
Errors = False
If Request("Mode") = "Send" And Request("Country") = "" Then Errors = True
If Request("Mode") = "Send" And Errors = False Then
REM ===== SEND AN EMAIL =====
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
'If Request("eMail") = "" Then eMail = "No E-Mail Given" Else eMail = Request("eMail")
Mailer.FromName = Request("Name")
Mailer.FromAddress = Request("eMail")
Mailer.RemoteHost = "mail.xxxxxxx.com"
Mailer.AddRecipient "TSF","
admin@XXXXXXX.com"
Mailer.Subject = "Contact Form From Website"
mBody = "Name: " & Request("Name") & vbCrLf
mBody = mBody & "Address: " & Request("Address") & vbCrLF
mBody = mBody & "City: " & Request("City") & vbCrLF
mBody = mBody & "State / Province: " & Request("State") & vbCrLF
mBody = mBody & "Zip Code: " & Request("ZipCode") & vbCrLF
mBody = mBody & "Country: " & Request("Country") & vbCrLF & vbCrLF
mBody = mBody & "Phone: " & Request("DayPhone") & vbCrLF
mBody = mBody & "Fax: " & Request("Fax") & vbCrLF
mBody = mBody & "E-Mail: " & Request("eMail") & vbCrLF & vbCrLF
mBody = mBody & "Comments: " & Request("Comments")
Mailer.BodyText = mBody
Mailer.SendMail
Set Mailer = Nothing
End If
Response.Write(request.Form("name")& ": The CAPTCHA code is correct")
'If CAPTCHA is NOT entered correctly run the following code
ElseIf Request("CAPTCHA_Postback") AND blnCAPTCHAcodeCorrect = False Then
'Place code here that is to run if CAPTCHA is NOT entered correctly
Response.Write(request.Form("name")& ": The CAPTCHA code is NOT correct")
End If
%>
<!-- END EMBEDDED TABLE (x) -->
<%End If%>