Solved

Help getting RECAPTCHA to display an error message when wrong CAPTCHA words are entered?

Posted on 2009-05-16
7
1,804 Views
Last Modified: 2012-05-07
Hi. I've got a conference registration form I built in ColdFusion 8. I'm using the RECAPTCHA custom CF tag solution:

http://recaptcha.net/
http://recaptcha.riaforge.org/

You can see the working form here:

https://www.ascassociation.org/june2009_test2.cfm

RECAPTCHA verifies the two RECAPTCHA words correctly. However, when the two words are entered <em>incorrectly</em>, my application displays a 404 error:

https://www.ascassociation.org/june2009_test2.cfm&recaptcha=false

I would like to send the user back to the registration form if she enters incorrect RECAPTCHA words -- and also display an error message at the top of the form: "Incorrect RECAPTCHA words entered; please try again."

... And I would like to preserve all of the information she entered there before she clicked the Submit button -- is that possible? It is a long, complex form and I do not want to exasperate users.

I attach two files:

june2009_test2.cfm

conference_data_insert_test2.cfm

I tried to comment thoroughly so that you can see what I did, where I did it, and why.

Can anybody give me any advice?

Thanks as always.

Peace,

Eric
june2009_test2.cfm:

<cfparam name="url.recaptcha" default="">
 
 

<!--- relocate http to https --->

<cfif CGI.https is "Off">

<cflocation url="https://#cgi.server_name##cgi.script_name#?#cgi.query_string#" addtoken="no" />

</cfif>

 

  

<!--- include secure header --->

<cfinclude template="/SiteHeaderSecure.cfm" />

 

<!--- When the user submits the Form, she sees the information that she sent --->

 

 

<cfif IsDefined('RegistrationID')>

 

   <!--- If RegistrationID is defined, display this "success" message to user --->

 

 <h2>Thank you for submitting information to register for ASC Communications and the Ambulatory Surgery Foundation's Orthopedic Spine and Pain Management-Driven Conference, June 11 &#8211; 13 2009, at the Westin Hotel in Chicago, Illinois.</h2>

 

  <p>Your form is being processed.  Within two weeks, you will receive official confirmation and your receipt of payment by email from the Ambulatory Surgery Foundation with meeting details.  Please don't hesitate to call the registration office with questions at 703.836.5904 or email <a href="mailto:registration@ascassociation.org">registration@ascassociation.org</a>.</p>

 

  <p>Here is the information you sent:</p>

  

  <!--- set default values --->

  <cfparam name="RegistrationID" default="">

  <cfparam name="FirstName" default="">

  <cfparam name="LastName" default="">

  <cfparam name="Degree" default="">

  <cfparam name="Title" default="">

  <cfparam name="FacilityCompany" default="">

  <cfparam name="Address1" default="">

  <cfparam name="Address2" default="">

  <cfparam name="City" default="">

  <cfparam name="State" default="">

  <cfparam name="Zip" default="">

  <cfparam name="Phone" default="">

  <cfparam name="Fax" default="">

  <cfparam name="Email" default="">

  <cfparam name="WebSite" default="">

  <cfparam name="RNLicenseNumber" default="">

  <cfparam name="MainConference1stAttendeeAmountBefore5May625" default="">

  <cfparam name="MainConference2ndAttendeeAmountBefore5May575" default="">

  <cfparam name="MainConference3rdAttendeeAmountBefore5May525" default="">

  <cfparam name="MainConference4thAttendeeAmountBefore5May500" default="">

  <cfparam name="MainConference1stAttendeeAmountAfter5May725" default="">

  <cfparam name="MainConference2ndAttendeeAmountAfter5May675" default="">

  <cfparam name="MainConference3rdAttendeeAmountAfter5May625" default="">

  <cfparam name="MainConference4thAttendeeAmountAfter5May600" default="">

  <cfparam name="MainandPreConference1stAttendeeAmountBefore5May825" default="">

  <cfparam name="MainandPreConference2ndAttendeeAmountBefore5May775" default="">

  <cfparam name="MainandPreConference3rdAttendeeAmountBefore5May725" default="">

  <cfparam name="MainandPreConference4thAttendeeAmountBefore5May700" default="">

  <cfparam name="MainandPreConference1stAttendeeAmountAfter5May925" default="">

  <cfparam name="MainandPreConference2ndAttendeeAmountAfter5May875" default="">

  <cfparam name="MainandPreConference3rdAttendeeAmountAfter5May825" default="">

  <cfparam name="MainandPreConference4thAttendeeAmountAfter5May800" default="">

  <cfparam name="BeckersASCReviewSpecialDiscount" default="">

  <cfparam name="ASCReviewSubscriberDiscountOneHundred" default="">

  <cfparam name="TotalEnclosed" default="">

  <cfparam name="FORM.CheckEnclosed" default="">

  <cfparam name="CheckNumber" default="">

  <cfparam name="FORM.AuthorizeCharge" default="">

  <cfparam name="CreditCard" default="">

  <cfparam name="CreditCardNumber" default="">

  <cfparam name="ExpirationDate" default="">

  <cfparam name="PrintedCardHolderName" default="">

  <cfparam name="CreditCardZIPCode" default="">

  <cfparam name="CVV" default="">

  <cfparam name="DateCreated" default="">

 

 

<cfoutput>
 

<p><strong>RegistrationID:</strong> #RegistrationID#</p>

<CFIF FirstName IS NOT ""><p><strong>First Name:</strong> #FirstName#</p></CFIF>

<CFIF LastName IS NOT ""><p><strong>Last Name:</strong> #LastName#</p></CFIF>

<p><strong>Credential:</strong> #Degree#</p>

<p><strong>Title:</strong> #Title#</p>

<CFIF FacilityCompany IS NOT ""><p><strong>Facility / Company:</strong> #FacilityCompany#</p></CFIF>

<p><strong>Address Line 1:</strong> #Address1#</p>

<CFIF Address2 IS NOT ""><p><strong>Address Line 2:</strong> #Address2#</p></CFIF>

<p><strong>City:</strong> #City#</p>

<p><strong>State:</strong> #State#</p>

<p><strong>Zip:</strong> #Zip#</p>

<p><strong>Phone:</strong> #Phone#</p>

<CFIF Fax IS NOT ""><p><strong>Fax:</strong> #Fax#</p></CFIF>

<p><strong>Email:</strong> #Email#</p>

<CFIF WebSite IS NOT ""><p><strong>Web Site:</strong> #WebSite#</p></CFIF>

 

<CFIF RNLicenseNumber IS NOT ""><p><strong>RN License Number:</strong>  #RNLicenseNumber#</p></CFIF>

 

<CFIF MainConference1stAttendeeAmountBefore5May625 IS NOT ""><p><strong>Main Conference 1st Attendee Amount Remitted Before 5 May 2009:</strong> #MainConference1stAttendeeAmountBefore5May625#</p></CFIF>

 

<CFIF MainConference2ndAttendeeAmountBefore5May575 IS NOT ""><p><strong>Main Conference 2nd Attendee Amount Remitted Before 5 May 2009:</strong> #MainConference2ndAttendeeAmountBefore5May575#</p></CFIF>

 

<CFIF MainConference3rdAttendeeAmountBefore5May525 IS NOT ""><p><strong>Main Conference 3rd Attendee Amount Remitted Before 5 May 2009:</strong> #MainConference3rdAttendeeAmountBefore5May525#</p></CFIF>

 

<CFIF MainConference4thAttendeeAmountBefore5May500 IS NOT ""><p><strong>Main Conference 4th Attendee Amount Remitted Before 5 May 2009:</strong> #MainConference4thAttendeeAmountBefore5May500#</p></CFIF>

 

<CFIF MainConference1stAttendeeAmountAfter5May725 IS NOT ""><p><strong>Main Conference 1st Attendee Amount Remitted After 5 May 2009:</strong> #MainConference1stAttendeeAmountAfter5May725#</p></CFIF>

 

<CFIF MainConference2ndAttendeeAmountAfter5May675 IS NOT ""><p><strong>Main Conference 2nd Attendee Amount Remitted After 5 May 2009:</strong> #MainConference2ndAttendeeAmountAfter5May675#</p></CFIF>

 

<CFIF MainConference3rdAttendeeAmountAfter5May625 IS NOT ""><p><strong>Main Conference 3rd Attendee Amount Remitted After 5 May 2009:</strong> #MainConference3rdAttendeeAmountAfter5May625#</p></CFIF>

 

<CFIF MainConference4thAttendeeAmountAfter5May600 IS NOT ""><p><strong>Main Conference 4th Attendee Amount Remitted After 5 May 2009:</strong> #MainConference4thAttendeeAmountAfter5May600#</p></CFIF>

 

<CFIF MainandPreConference1stAttendeeAmountBefore5May825 IS NOT ""><p><strong>Main and PreConference 1st Attendee Amount Remitted Before 5 May 2009:</strong> #MainandPreConference1stAttendeeAmountBefore5May825#</p></CFIF>

 

<CFIF MainandPreConference2ndAttendeeAmountBefore5May775 IS NOT ""><p><strong>Main and PreConference 2nd Attendee Amount Remitted Before 5 May 2009:</strong> #MainandPreConference2ndAttendeeAmountBefore5May775#</p></CFIF>

 

<CFIF MainandPreConference3rdAttendeeAmountBefore5May725 IS NOT ""><p><strong>Main and PreConference 3rd Attendee Amount Remitted Before 5 May 2009:</strong> #MainandPreConference3rdAttendeeAmountBefore5May725#</p></CFIF>

 

<CFIF MainandPreConference4thAttendeeAmountBefore5May700 IS NOT ""><p><strong>Main and PreConference 4th Attendee Amount Remitted Before 5 May 2009:</strong> #MainandPreConference4thAttendeeAmountBefore5May700#</p></CFIF>

 

<CFIF MainandPreConference1stAttendeeAmountAfter5May925 IS NOT ""><p><strong>Main and PreConference 1st Attendee Amount Remitted After 5 May 2009:</strong> #MainandPreConference1stAttendeeAmountAfter5May925#</p></CFIF>

 

<CFIF MainandPreConference2ndAttendeeAmountAfter5May875 IS NOT ""><p><strong>Main and PreConference 2nd Attendee Amount Remitted After 5 May 2009:</strong> #MainandPreConference2ndAttendeeAmountAfter5May875#</p></CFIF>

 

<CFIF MainandPreConference3rdAttendeeAmountAfter5May825 IS NOT ""><p><strong>Main and PreConference 3rd Attendee Amount Remitted After 5 May 2009:</strong> #MainandPreConference3rdAttendeeAmountAfter5May825#</p></CFIF>

 

<CFIF MainandPreConference4thAttendeeAmountAfter5May800 IS NOT ""><p><strong>Main and PreConference 4th Attendee Amount Remitted After 5 May 2009:</strong> #MainandPreConference4thAttendeeAmountAfter5May800#</p></CFIF>

 

<CFIF BeckersASCReviewSpecialDiscount IS NOT ""><p><strong>Beckers ASC Review Special Discount:</strong> #BeckersASCReviewSpecialDiscount#</p></CFIF>

<CFIF ASCReviewSubscriberDiscountOneHundred IS NOT ""><p><strong>ASC Review Subscriber Discount ($50):</strong> #ASCReviewSubscriberDiscountOneHundred#</p></CFIF>

<CFIF TotalEnclosed IS NOT ""><p><strong>Total Enclosed:</strong> #TotalEnclosed#</p></CFIF>

<CFIF CheckEnclosed IS NOT ""><p><strong>Check Enclosed:</strong> #FORM.CheckEnclosed#</p></CFIF>

<CFIF CheckNumber IS NOT ""><p><strong>Check Number:</strong> #CheckNumber#</p></CFIF>

<CFIF AuthorizeCharge IS NOT ""><p><strong>Authorize Charge:</strong> #FORM.AuthorizeCharge#</p></CFIF>

<CFIF CreditCard IS NOT ""><p><strong>Credit Card:</strong> #CreditCard#</p></CFIF>

<CFIF CreditCardNumber IS NOT ""><p><strong>Credit Card Number:</strong> (Obscured for security)</p></CFIF>

<CFIF ExpirationDate IS NOT ""><p><strong>Expiration Date:</strong> (Obscured for security)</p></CFIF>

<CFIF PrintedCardHolderName IS NOT ""><p><strong>Printed Card Holder Name:</strong> #PrintedCardHolderName#</p></CFIF>

<CFIF CreditCardZIPCode IS NOT ""><p><strong>Credit Card ZIP Code:</strong> #CreditCardZIPCode#</p></CFIF>

<CFIF CVV IS NOT ""><p><strong>CVV:</strong> #CVV#</p></CFIF>

<p><strong>Date Submitted:</strong> #DateCreated#</p>

  

</cfoutput>

 

 

  

  <!--- If RegistrationID not defined, then display the form to the user ---> 

<cfelse>

 

 
 

        

        

 

 

 <!--- This is a form to populate conference registration information in table RegistrationEntries --->

 

<cfform action="/conference_data_insert_test2.cfm" enctype="multipart/form-data" onSubmit="return submitForm(this)">

 

  

  <h1>Orthopedic Spine and Pain Management-Driven Conference</h1>

 

 <h3>June 11 &#8211; 13 2009</h3>

 

<h3>Westin Hotel, Chicago, Illinois</h3>

 

  

<h2>REGISTRATION INFORMATION</h2>

 

	<table class="uvatable">

	<tr><td class="uvatable-left"><strong>First Name:</strong> <span class="rede31b23"><strong>*</strong></span></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="FirstName" tabindex="1" required="yes" message="Please enter your First Name" /></td></tr>

	<tr><td class="uvatable-left"><strong>Last Name:</strong> <span class="rede31b23"><strong>*</strong></span></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="LastName" tabindex="2" required="yes" message="Please enter your Last Name"  /></td></tr>

		<tr><td class="uvatable-left"><strong>Credential:</strong></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="Degree" tabindex="3" /></td></tr>

		<tr><td class="uvatable-left"><strong>Title:</strong></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="Title" tabindex="4" /></td></tr>

	<tr><td class="uvatable-left"><strong>Facility / Company:</strong></td> 	<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="FacilityCompany" tabindex="5" /></td></tr>

	<tr><td class="uvatable-left"><strong>Address Line 1:</strong></td> 		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="Address1" tabindex="6" /></td></tr>

		<tr><td class="uvatable-left"><strong>Address Line 2:</strong></td> 		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="Address2" tabindex="7" /></td></tr>

	<tr><td class="uvatable-left"><strong>City:</strong></td> 		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="City" tabindex="8" /></td></tr>

	<tr><td class="uvatable-left"><strong>State:</strong></td> 		<td class="uvatable-right">

    <SELECT NAME="state" size="1" id="state" style="width:150;" tabindex="9" title="State/Province" class="ChicagoSelect">

                <OPTION VALUE="0" selected> Select State/Province </OPTION>

                <OPTION VALUE = "AK">Alaska</OPTION><OPTION VALUE = "AL">Alabama</OPTION><OPTION VALUE = "AR">Arkansas</OPTION><OPTION VALUE = "AZ">Arizona</OPTION><OPTION VALUE = "CA">California</OPTION><OPTION VALUE = "CO">Colorado</OPTION><OPTION VALUE = "CT">Connecticut</OPTION><OPTION VALUE = "DC">District of Columbia</OPTION><OPTION VALUE = "DE">Delaware</OPTION><OPTION VALUE = "FL">Florida</OPTION><OPTION VALUE = "GA">Georgia</OPTION><OPTION VALUE = "HI">Hawaii</OPTION><OPTION VALUE = "IA">Iowa</OPTION><OPTION VALUE = "ID">Idaho</OPTION><OPTION VALUE = "IL">Illinois</OPTION><OPTION VALUE = "IN">Indiana</OPTION><OPTION VALUE = "KS">Kansas</OPTION><OPTION VALUE = "KY">Kentucky</OPTION><OPTION VALUE = "LA">Louisiana</OPTION><OPTION VALUE = "MA">Massachusetts</OPTION><OPTION VALUE = "MD">Maryland</OPTION><OPTION VALUE = "ME">Maine</OPTION><OPTION VALUE = "MI">Michigan</OPTION><OPTION VALUE = "MN">Minnesota</OPTION><OPTION VALUE = "MO">Missouri</OPTION><OPTION VALUE = "MS">Mississippi</OPTION><OPTION VALUE = "MT">Montana</OPTION><OPTION VALUE = "NC">North Carolina</OPTION><OPTION VALUE = "ND">North Dakota</OPTION><OPTION VALUE = "NE">Nebraska</OPTION><OPTION VALUE = "NH">New Hampshire</OPTION><OPTION VALUE = "NJ">New Jersey</OPTION><OPTION VALUE = "NM">New Mexico</OPTION><OPTION VALUE = "NV">Nevada</OPTION><OPTION VALUE = "NY">New York</OPTION><OPTION VALUE = "OH">Ohio</OPTION><OPTION VALUE = "OK">Oklahoma</OPTION><OPTION VALUE = "OR">Oregon</OPTION><OPTION VALUE = "PA">Pennsylvania</OPTION><OPTION VALUE = "RI">Rhode Island</OPTION><OPTION VALUE = "SC">South Carolina</OPTION><OPTION VALUE = "SD">South Dakota</OPTION><OPTION VALUE = "TN">Tennessee</OPTION><OPTION VALUE = "TX">Texas</OPTION><OPTION VALUE = "UT">Utah</OPTION><OPTION VALUE = "VA">Virginia</OPTION><OPTION VALUE = "VT">Vermont</OPTION><OPTION VALUE = "WA">Washington</OPTION><OPTION VALUE = "WI">Wisconsin</OPTION><OPTION VALUE = "WV">West Virginia</OPTION><OPTION VALUE = "WY">Wyoming</OPTION></SELECT>

    

  </td></tr>	

	<tr><td class="uvatable-left"><strong>ZIP:</strong></td> 		<td class="uvatable-right"><cfinput TYPE="text" SIZE="5" NAME="Zip" tabindex="10" /></td></tr>

	<tr><td class="uvatable-left"><strong>Phone:</strong></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="20" NAME="Phone" tabindex="11" /></td></tr>

	<tr><td class="uvatable-left"><strong>Fax:</strong></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="20" NAME="Fax" tabindex="12" /></td></tr>

	<tr><td class="uvatable-left"><strong>Email:</strong> <span class="rede31b23"><strong>*</strong></span></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="Email" tabindex="13" required="yes" message="Please enter your Email Address"  /></td></tr>

		<tr><td class="uvatable-left"><strong>Web Site:</strong></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="WebSite" tabindex="14" /></td></tr>

 

<tr><td class="uvatable-left"><strong>RN License Number:</strong></td>		<td class="uvatable-right"><cfinput TYPE="text" SIZE="30" NAME="RNLicenseNumber" tabindex="15" /></td></tr>

 

 
 

 

 

	</table>

    

    

     <p class="rede31b23"><strong>* Required</strong></p> 

	

<h1>REGISTRATION FEES</h1>

 

 <p>Receive multiple registrant discount(s). The more people you send the greater discount you receive. The prices listed

below are per person. Simply submit a separate registration form for each attendee. Your registration includes all conference sessions, materials and meal functions.</p>

 

 

<h2>MAIN CONFERENCE ONLY</h2>

 

	<table class="uvatable">

<tr>

	<td></td>

	<td class="uvatable-left"><strong>FEES<br />(Before 5/5/2009)</strong></td>

	<td class="uvatable-left"><strong>ENTER AMOUNT</strong></td>

	<td class="uvatable-left"><strong>FEES<br />(After 5/5/2009)</strong></td>

	<td class="uvatable-left"><strong>ENTER AMOUNT</strong></td>

 

</tr>

<tr>

	<td class="uvatable-left">1st Attendee</td>

	<td class="uvatable-left">$625</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference1stAttendeeAmountBefore5May625" tabindex="16" /></td>

	<td class="uvatable-left">$725</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference1stAttendeeAmountAfter5May725" tabindex="17" /></td>

 

</tr>

<tr>

	<td class="uvatable-left">2nd Attendee</td>

	<td class="uvatable-left">$575</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference2ndAttendeeAmountBefore5May575" tabindex="18" /></td>

	<td class="uvatable-left">$675</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference2ndAttendeeAmountAfter5May675" tabindex="19" /></td>

</tr>

<tr>

	<td class="uvatable-left">3rd Attendee</td>

	<td class="uvatable-left">$525</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference3rdAttendeeAmountBefore5May525" tabindex="20" /></td>

	<td class="uvatable-left">$625</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference3rdAttendeeAmountAfter5May625" tabindex="21" /></td>

 

</tr>

<tr>

	<td class="uvatable-left">4th Attendee or more</td>

	<td class="uvatable-left">$500</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference4thAttendeeAmountBefore5May500" tabindex="22" /></td>

	<td class="uvatable-left">$600</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainConference4thAttendeeAmountAfter5May600" tabindex="23" /></td>

 

</tr>

</table>

 

<p><em>Ask about larger group discounts.</em></p>

 

 

<h2>MAIN CONFERENCE + PRE-CONFERENCE</h2>

 

	<table class="uvatable">

<tr>

	<td></td>

	<td><strong>FEES<br />(Before 5/5/2009)</strong></td>

	<td><strong>ENTER AMOUNT</strong></td>

	<td><strong>FEES<br />(After 5/5/2009)</strong></td>

	<td><strong>ENTER AMOUNT</strong></td>

 

</tr>

<tr>

	<td class="uvatable-left">1st Attendee</td>

	<td class="uvatable-left">$825</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference1stAttendeeAmountBefore5May825" tabindex="24" /></td>

	<td class="uvatable-left">$925</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference1stAttendeeAmountAfter5May925" tabindex="25" /></td>

 

</tr>

<tr>

	<td class="uvatable-left">2nd Attendee</td>

	<td class="uvatable-left">$775</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference2ndAttendeeAmountBefore5May775" tabindex="26" /></td>

	<td class="uvatable-left">$875</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference2ndAttendeeAmountAfter5May875" tabindex="27" /></td>

</tr>

<tr>

	<td class="uvatable-left">3rd Attendee</td>

	<td class="uvatable-left">$725</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference3rdAttendeeAmountBefore5May725" tabindex="28" /></td>

	<td class="uvatable-left">$825</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference3rdAttendeeAmountAfter5May825" tabindex="29" /></td>

 

</tr>

<tr>

	<td class="uvatable-left">4th Attendee or more</td>

	<td class="uvatable-left">$700</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference4thAttendeeAmountBefore5May700" tabindex="30" /></td>

	<td class="uvatable-left">$800</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="MainandPreConference4thAttendeeAmountAfter5May800" tabindex="31" /></td>

 

</tr>

</table>

 

 

 

<h2>OPTIONAL</h2>

 

<table class="uvatable">

<tr>

	<td class="uvatable-left">Becker's ASC Review Special Discount Offer</td>

	<td class="uvatable-left">$100 (per year) </td>

	<td><cfinput TYPE="text" SIZE="30" NAME="BeckersASCReviewSpecialDiscount" tabindex="32" /></td>

</tr>

<tr>

	<td class="uvatable-left">$100 Discount per attendee if paid ASC Association Member

or Becker's ASC Review Subscriber </td>

	<td class="uvatable-left">(- $100) </td>

	<td><cfinput TYPE="text" SIZE="30" NAME="ASCReviewSubscriberDiscountOneHundred" tabindex="33" /></td>

</tr>

<tr>

	<td></td>

	<td class="uvatable-left"><strong>TOTAL ENCLOSED</strong></td>

	<td><cfinput TYPE="text" SIZE="30" NAME="TotalEnclosed" tabindex="34" /></td>

</tr>

</table>

 

 

 

 

<h1>PAYMENT INFORMATION</h1>

 

<p>To remit payment, you may print this form and mail it to Ambulatory Surgery Foundation with a check (see information below). Or, submit your credit card information, below. Credit card information is submitted through a secure connection, certified by SecureTrust.</p>

 

<p class="float-left"><cfinput type="Checkbox" name="CheckEnclosed"  class="border0" tabindex="35" /> Enclosed is a check, payable to Ambulatory Surgery Foundation.</p> 

 

<p class="float-right">Check # <cfinput TYPE="text" SIZE="30" NAME="CheckNumber" tabindex="36" /></p>

 

<div class="clear-both"></div>

 

<p class="float-left"><cfinput type="Checkbox" name="AuthorizeCharge" class="border0" tabindex="37" /> I authorize Ambulatory Surgery Foundation to charge my:</p>

 

<p class="float-right">

<select name="CreditCard" class="ChicagoSelect red" tabindex="38">

<option value="SelectCard">Select a Credit Card</option>

<option value="Visa">Visa</option>

<option value="MasterCard">MasterCard</option>

<option value="AmericanExpress">American Express</option></select></p>

 

 

<div class="clear-both"></div>

 

 

<table class="uvatable">

<tr>

	<td>Credit Card Number:</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="CreditCardNumber" tabindex="39" /></td>

	<td>Expiration Date:</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="ExpirationDate" tabindex="40" /></td>

</tr>

<tr>

	<td>Printed Cardholder Name:</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="PrintedCardHolderName" tabindex="41" /></td>

	<td>Zip Code:</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="CreditCardZIPCode" tabindex="42" /></td>

</tr>

<tr>

	<td>Signature (if printing and mailing):</td>

	<td></td>

	<td>CVV#/3-digit #:</td>

	<td><cfinput TYPE="text" SIZE="30" NAME="CVV" tabindex="43" /></td>

</tr>

</table>
 
 

<!--- begin CAPTCHA --->
 
 

<!--- captcha_box --->

<div class="captcha_box">

  

  <!--- captcha_box_left --->

     <div class="captcha_box_left">

     <p><strong>Please type the two words that you see to the right. This is a necessary antispam measure. Our apologies for the inconvenience. Type carefully. Then, click Send Registration.</strong></p>

     </div>

            <!--- /captcha_box_left --->  

       

        

          <!--- captcha_box_right --->

        <div class="captcha_box_right"><cfif url.recaptcha eq "false"><p><strong>Captcha Authentication Failed. Please try again.</strong></p>

      </cfif>

  

  

    <cf_recaptcha privateKey="xxxxxx"	publicKey="xxxxxx"	theme="white">

     

     </div>

      <!--- /captcha_box_right --->

     

     

  <!--- end CAPTCHA --->

  

 

 <!--- /captcha_box --->

 </div>
 

  

 

  <!--- submit form --->

      

<p class="align-center"><cfinput type="submit" name="submit" value="Send Registration" tabindex="45" /></p>

 

  <!--- close CFFORM --->

</cfform>
 
 

 

  <p class="rede31b23"><strong>* Required</strong></p> 

 

<h1>OTHER WAYS TO REGISTER</h1>

 

 

<h2>PRINT THIS FORM AND MAIL OR FAX AS FOLLOWS:</h2>

 

 

 

<p><strong>Mail:</strong> Make checks payable to Ambulatory Surgery Foundation and mail to:

Ambulatory Surgery Foundation, 1012 Cameron St, Alexandria, VA 22314</p>

 

<p><strong>Fax:</strong> Fax registration form with credit card information to 703.836.2090</p>

 

<p><strong>Call:</strong> Call 703.836.5904 to register by phone</p>

 

<p><strong>Cancellation policy:</strong> Written cancellation requests must be received by May 5, 2009. Refunds are subject to a $100 processing fee.

Refunds will not be issued after this date.</p>

 

<p>Fax registration form with credit card information to 703.836.2090.</p>

 

<!--- close CFIF --->

</cfif> 

 

 

 

<p>If you have trouble sending the form, please print and fax to 703.836.2090.</p>

 

	

<p>This information will be used only in conjunction with Ambulatory Surgery Foundation and ASC Association business. We will not share your information with any other organizations.</p>

 

 

<hr />

 

<!--- TrustWave Seal ---> 

<p class="float-left-img"><script type='text/javascript' src='https://sealserver.trustwave.com/seal.js?style=normal'></script></p>

 

 

 <p>Transactions on this web page are secured by Trustwave. Click the Trustwave logo to the left to verify the security of this page.</p>

 

 

  <!--- include secure footer ---> 

<cfinclude template="SiteFooterSecure.cfm" />
 
 
 

conference_data_insert_test2.cfm
 

<cfif isDefined('FORM.CheckEnclosed')>

<!--- checkbox has been checked and is present in post data --->

<cfset CheckEnclosed = 1>

<cfelse>

<cfset CheckEnclosed = 0>

<!--- checkbox not checked and not present --->

</cfif>

 

<cfif isDefined('FORM.AuthorizeCharge')>

<!--- checkbox has been checked and is present in post data --->

<cfset AuthorizeCharge = 1>

<cfelse>

<cfset AuthorizeCharge = 0>

<!--- checkbox not checked and not present --->

</cfif>

 

<!--- Insert values into database columns --->

<cfquery datasource="ebwebwork" dbname="ascassociation" name="createRegistration">

	INSERT INTO RegistrationEntries (

		FirstName,

		LastName,

		Degree,

		Title,

		FacilityCompany,

		Address1,

		Address2,

		City,

		State,

		Zip,

		Phone,

		Fax,

		Email,

		WebSite,

		RNLicenseNumber,

		MainConference1stAttendeeAmountBefore5May625,

		MainConference2ndAttendeeAmountBefore5May575,

		MainConference3rdAttendeeAmountBefore5May525,

		MainConference4thAttendeeAmountBefore5May500,

		MainConference1stAttendeeAmountAfter5May725,

		MainConference2ndAttendeeAmountAfter5May675,

		MainConference3rdAttendeeAmountAfter5May625,

		MainConference4thAttendeeAmountAfter5May600,

		MainandPreConference1stAttendeeAmountBefore5May825,

		MainandPreConference2ndAttendeeAmountBefore5May775,

		MainandPreConference3rdAttendeeAmountBefore5May725,

		MainandPreConference4thAttendeeAmountBefore5May700,

		MainandPreConference1stAttendeeAmountAfter5May925,

		MainandPreConference2ndAttendeeAmountAfter5May875,

		MainandPreConference3rdAttendeeAmountAfter5May825,

		MainandPreConference4thAttendeeAmountAfter5May800,

		BeckersASCReviewSpecialDiscount,

		ASCReviewSubscriberDiscountOneHundred,

		TotalEnclosed,

		CheckEnclosed,

		CheckNumber,

		AuthorizeCharge,

		CreditCard,

		CreditCardNumber,

		ExpirationDate,

		PrintedCardHolderName,

		CreditCardZIPCode,

		CVV,

		DateCreated)

	VALUES(

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#FirstName#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#LastName#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Degree#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Title#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#FacilityCompany#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Address1#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Address2#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#City#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#State#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Zip#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Phone#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Fax#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#Email#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#WebSite#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#RNLicenseNumber#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference1stAttendeeAmountBefore5May625#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference2ndAttendeeAmountBefore5May575#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference3rdAttendeeAmountBefore5May525#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference4thAttendeeAmountBefore5May500#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference1stAttendeeAmountAfter5May725#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference2ndAttendeeAmountAfter5May675#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference3rdAttendeeAmountAfter5May625#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainConference4thAttendeeAmountAfter5May600#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference1stAttendeeAmountBefore5May825#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference2ndAttendeeAmountBefore5May775#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference3rdAttendeeAmountBefore5May725#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference4thAttendeeAmountBefore5May700#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference1stAttendeeAmountAfter5May925#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference2ndAttendeeAmountAfter5May875#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference3rdAttendeeAmountAfter5May825#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#MainandPreConference4thAttendeeAmountAfter5May800#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#BeckersASCReviewSpecialDiscount#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#ASCReviewSubscriberDiscountOneHundred#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#TotalEnclosed#">,

		<cfqueryparam cfsqltype="cf_sql_bit" value="#CheckEnclosed#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#CheckNumber#">,

		<cfqueryparam cfsqltype="cf_sql_bit" value="#AuthorizeCharge#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#CreditCard#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#CreditCardNumber#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#ExpirationDate#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#PrintedCardHolderName#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#CreditCardZIPCode#">,

		<cfqueryparam cfsqltype="cf_sql_varchar" value="#CVV#">,

		<cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">);

	SELECT scope_identity() AS ident

</cfquery>

		  

<!--- pass info back to previous page --->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html>

<head>

	<title>Registration Submitted</title>

</head>

 

<body onLoad="document.form.submit();">
 

   <!--- if form is submitted, check CAPTCHA --->

 

 <cfif isDefined('form.submit')>

	 	<cf_recaptcha privateKey="xxxxxx"

					publicKey="xxxxxx"

					action="check">

	<cfif form.recaptcha eq "true">

 

 

  <!--- post inputs from form --->

  

 <cfoutput>

 

<form name="form" method="post" action="june2009_test2.cfm">

 

<!--- set value from newly created RegistrationID --->

<input type="hidden" name="RegistrationID" value="#createRegistration.ident#">

<!--- set rest of values from submitted form --->

<input type="hidden" name="FirstName" value="#FORM.FirstName#">

<input type="hidden" name="LastName" value="#FORM.LastName#">

<input type="hidden" name="Degree" value="#FORM.Degree#">

<input type="hidden" name="Title" value="#FORM.Title#">

<input type="hidden" name="FacilityCompany" value="#FORM.FacilityCompany#">

<input type="hidden" name="Address1" value="#FORM.Address1#">

<input type="hidden" name="Address2" value="#FORM.Address2#">

<input type="hidden" name="City" value="#FORM.City#">

<input type="hidden" name="State" value="#FORM.State#">

<input type="hidden" name="Zip" value="#FORM.Zip#">

<input type="hidden" name="Phone" value="#FORM.Phone#">

<input type="hidden" name="Fax" value="#FORM.Fax#">

<input type="hidden" name="Email" value="#FORM.Email#">

<input type="hidden" name="WebSite" value="#FORM.WebSite#">

<input type="hidden" name="RNLicenseNumber" value="#FORM.RNLicenseNumber#">

<input type="hidden" name="MainConference1stAttendeeAmountBefore5May625" value="#FORM.MainConference1stAttendeeAmountBefore5May625#">

<input type="hidden" name="MainConference2ndAttendeeAmountBefore5May575" value="#FORM.MainConference2ndAttendeeAmountBefore5May575#">

<input type="hidden" name="MainConference3rdAttendeeAmountBefore5May525" value="#FORM.MainConference3rdAttendeeAmountBefore5May525#">

<input type="hidden" name="MainConference4thAttendeeAmountBefore5May500" value="#FORM.MainConference4thAttendeeAmountBefore5May500#">

<input type="hidden" name="MainConference1stAttendeeAmountAfter5May725" value="#FORM.MainConference1stAttendeeAmountAfter5May725#">

<input type="hidden" name="MainConference2ndAttendeeAmountAfter5May675" value="#FORM.MainConference2ndAttendeeAmountAfter5May675#">

<input type="hidden" name="MainConference3rdAttendeeAmountAfter5May625" value="#FORM.MainConference3rdAttendeeAmountAfter5May625#">

<input type="hidden" name="MainConference4thAttendeeAmountAfter5May600" value="#FORM.MainConference4thAttendeeAmountAfter5May600#">

<input type="hidden" name="MainandPreConference1stAttendeeAmountBefore5May825" value="#FORM.MainandPreConference1stAttendeeAmountBefore5May825#">

<input type="hidden" name="MainandPreConference2ndAttendeeAmountBefore5May775" value="#FORM.MainandPreConference2ndAttendeeAmountBefore5May775#">

<input type="hidden" name="MainandPreConference3rdAttendeeAmountBefore5May725" value="#FORM.MainandPreConference3rdAttendeeAmountBefore5May725#">

<input type="hidden" name="MainandPreConference4thAttendeeAmountBefore5May700" value="#FORM.MainandPreConference4thAttendeeAmountBefore5May700#">

<input type="hidden" name="MainandPreConference1stAttendeeAmountAfter5May975" value="#FORM.MainandPreConference1stAttendeeAmountAfter5May925#">

<input type="hidden" name="MainandPreConference2ndAttendeeAmountAfter5May875" value="#FORM.MainandPreConference2ndAttendeeAmountAfter5May875#">

<input type="hidden" name="MainandPreConference3rdAttendeeAmountAfter5May825" value="#FORM.MainandPreConference3rdAttendeeAmountAfter5May825#">

<input type="hidden" name="MainandPreConference4thAttendeeAmountAfter5May800" value="#FORM.MainandPreConference4thAttendeeAmountAfter5May800#">

<input type="hidden" name="BeckersASCReviewSpecialDiscount" value="#FORM.BeckersASCReviewSpecialDiscount#">

<input type="hidden" name="ASCReviewSubscriberDiscountOneHundred" value="#FORM.ASCReviewSubscriberDiscountOneHundred#">

<input type="hidden" name="TotalEnclosed" value="#FORM.TotalEnclosed#">

 

 

<cfif isdefined("form.CheckEnclosed")>

<input type="hidden" name="CheckEnclosed" value="#FORM.CheckEnclosed#">

<cfelse>

<input type="hidden" name="CheckEnclosed" value="0">

</cfif>

 

 

<input type="hidden" name="CheckNumber" value="#FORM.CheckNumber#">

 

<cfif isdefined("form.AuthorizeCharge")>

<input type="hidden" name="AuthorizeCharge" value="#FORM.AuthorizeCharge#">

<cfelse>

<input type="hidden" name="AuthorizeCharge" value="0">

</cfif>

 

 

<input type="hidden" name="CreditCard" value="#FORM.CreditCard#">

<input type="hidden" name="CreditCardNumber" value="#FORM.CreditCardNumber#">

<input type="hidden" name="ExpirationDate" value="#FORM.ExpirationDate#">

<input type="hidden" name="PrintedCardHolderName" value="#FORM.PrintedCardHolderName#">

<input type="hidden" name="CreditCardZIPCode" value="#FORM.CreditCardZIPCode#">

<input type="hidden" name="CVV" value="#FORM.CVV#">

<input type="hidden" name="DateCreated" value="#DateFormat(now(), "mm/dd/yyyy")#">

 

</form>

 </cfoutput>

 

 

  <!--- if CAPTCHA fails, go back to registration form, display error --->

   <cfelse>

           

            <cflocation url="june2009_test2.cfm&recaptcha=#form.recaptcha#" addtoken="no">

      </cfif>

      

</cfif>
 

 

 

</body>

</html>

Open in new window

0
Comment
Question by:Eric Bourland
  • 4
  • 3
7 Comments
 
LVL 16

Expert Comment

by:duncancumming
Comment Utility
ok, so if validation fails you pass in a url parameter, recaptcha.  that's the key to working out if you need to display the error message.  try something like:

  <!--- If RegistrationID not defined, then display the form to the user --->
<cfelse>
 
 <cfif StructKeyExists(URL, "recaptcha")>
<!--- error message --->
Incorrect RECAPTCHA words entered; please try again.
</cfif>
 
 
 <!--- This is a form to populate conference registration information in table RegistrationEntries --->
 
<cfform action="/conference_data_insert_test2.cfm" enctype="multipart/form-data" onSubmit="return submitForm(this)">
 

If you want to populate all the form fields, either you have to pass all the values back through the URL, or you use a shared scope like the Session scope to store all the form values.  


One other thing to point out, your conference_data_insert_test2.cfm file seems to create a form, populate the form, then use javascript to automatically submit the form.  You may want to look at rewriting this to use <cfhttp> to post the form server-side rather than client-side.  what would happen if your user disabled javascript?  
0
 
LVL 3

Author Comment

by:Eric Bourland
Comment Utility
Duncan,

Good to hear from you. Thanks for these ideas. I will work on them and get back to you later today.

Best from Eric
0
 
LVL 3

Author Comment

by:Eric Bourland
Comment Utility
Duncan,

I agree with you about using a Session scope to store form variables, and using cfhttp to post the form server side, rather than javascript to post the form client side. These are two tasks I will work on separately. I realize that I need to pay attention to these tasks. I am very grateful that you brought these matters to my attention.

I added your code, below, to my june2009_test2.cfm file. I see what you are doing, but I think I need to do something else, since this does not give me the result that I want. If you look at the test page:

https://www.ascassociation.org/june2009_test2.cfm

You will see that the error message is displayed by default.

Currently I am trying to see how to apply your idea only when the user submits the form, but enters incorrect CAPTCHA words.

I'm trying to arrive at this solution without bothering you further. But if you have any hints, I am very grateful for them. =)

Thanks very much for your time.

Eric
 <cfif StructKeyExists(URL, "recaptcha")>

<!--- error message --->

Incorrect RECAPTCHA words entered; please try again.

</cfif>

Open in new window

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 16

Accepted Solution

by:
duncancumming earned 500 total points
Comment Utility
My mistake, I failed to see that you had already defined your URL variable:
<cfparam name="url.recaptcha" default="">

Change that if statement to:


<cfif Len(URL.recaptcha)>

<!--- error message --->

Incorrect RECAPTCHA words entered; please try again.

</cfif>

Open in new window

0
 
LVL 3

Author Comment

by:Eric Bourland
Comment Utility
Duncan,

That makes more sense.

OK, I entered the code you recommended, and now the RECAPTCHA error message does not appear by default -- that's good. Also, if I enter correct RECAPTCHA words, the form works properly.

However, if I enter incorrect CAPTCHA words, I still get redirected to a 404 Not Found error page.

That is probably because of this code at the end of conference_data_insert_test2.cfm:

  <!--- if CAPTCHA fails, go back to registration form, display error --->
   <cfelse>
           
            <cflocation url="june2009_test2.cfm&recaptcha=#form.recaptcha#" addtoken="no">
      </cfif>
     
</cfif>

But if I take away that code, then RECAPTCHA does not work at all.

Any advice?

Thanks for taking time for this on a weekend.

Eric

0
 
LVL 16

Expert Comment

by:duncancumming
Comment Utility
that's because you've got a & where you should have a ?
try:
<cflocation url="june2009_test2.cfm?recaptcha=#form.recaptcha#" addtoken="no">
0
 
LVL 3

Author Closing Comment

by:Eric Bourland
Comment Utility
Duncan, this worked great. I am studying this solution. I will consider, in my next question, the cfhttp and using the session scope to store variables.

Thanks very much for your help. Have a great evening.

Eric
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now