Skip to main content
Inspiring
December 23, 2009
Question

web form spam continued . . .

  • December 23, 2009
  • 2 replies
  • 1108 views

HI, I have tried adding a hidden field to my web form to help reduce spam. I am not sure what I tried will work and do I need to and how do I add some code to specify do not process form if this field is filled in?

Here is what I tried so far and any help would be awesome - Thanks Jim

<!--- rest of form above--->

<div style="display:none; visibility:hidden;">

     <label for="contact_email">Please leave this field blank:</label>

     <cfinput type="text" name="contact_email">

</div>

<div class="register">             
            <cfinput type="submit" name="submit" value="Register">

            <cfinput type="reset" name="Reset " value="Reset Form">         

</div>

               </fieldset>

</cfform>

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    December 24, 2009

    I cannot see how anything you've said or done so far will help reduce web-form spam. Assuming you wish to prevent someone from maliciously submitting a form 10000 times to your site, then you have to use a CAPTCHA.

    There is no easy, 1-2-3 way to add CAPTCHA to your application. However, some ways are easier than others. I would recommend Raymond Camden's Quick and dirty CAPTCHA Guide - for ColdFusion 8. It uses Coldfusion 8's in-built CAPTCHA functionality, and is relatively easy to adopt.

    BKBK
    Community Expert
    Community Expert
    December 23, 2009

    Your hidden form field is so hidden it is invisible!

    rockhikerAuthor
    Inspiring
    December 23, 2009

    what do you mean? will this work? - jim

    Inspiring
    December 23, 2009

    Jim,

    Are looking for something like the sample below?

    <!--- if form submission lacks contact_email field or contact_email is not empty stop processing --->

    <cfif not IsDefined("form.contact_email") or form.contact_email neq "">

         <cfabort />

    </cfif>