• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Spambot Form Entry Prevention using CSS & Coldfusion 4.5

New Here ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

Hello,

I have an html form using a coldfusion post script. I want to create a hidden field using CSS which only spambots will see. Then I need some coldfusion code to tell the form not to submit entries with that field filled in. Is there a good tutorial or site someone knows to explain this for me.

Many Thanks

JD
TOPICS
Advanced techniques

Views

862

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

Hi,

You mean putting 'CAPTCHA' like thing in your page to prevent the SPAM Bots?...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

well a CAPTCHA is good but i don't want to give my users more reason not to fill in my form, so a hidden form field that a spambot would naturally fill in without realising is my best bet. any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

Then add a piece of javascript to check whether the hidden field is filled in with any value or not, and submit the form only if its empty..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

do you have an example of some code, i'm not that skilled in javascript. thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied


like this,

function fnValidate()
{
if (document.your_form_name.hidden_field_name.value=='')
{
document.your_form_name.action='your_actionpage.cfm';
document.your_form_name.submit();
}
}

and call this function in your <form> tag's onSubmit event like this,

<form name="your_form_name" method="post" onSubmit="return fnValidate();">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2007 May 15, 2007

Copy link to clipboard

Copied

hi, thanks for that, i think its worked, fingers crossed for the results and those pesky spambots stop annoying me 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 16, 2007 May 16, 2007

Copy link to clipboard

Copied

ok slight problem, whilst the code you gave me was very helpful it seems i need a different fix :

I don't want the spambots to not actually process the form entry, i wish to recieve it but just to a new address spam@hostname.com. By telling the form to process to a new your_actionpage.cfm isn't 100% there. The mail action is obviously controlled by the aplication.cfm which currently can only send to one mailserver. Is there an if comment i can put in the application.cfm which selects variables to send to a different address?

I hope this makes sense. thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 16, 2007 May 16, 2007

Copy link to clipboard

Copied

Hi,

Then put some conditions in your <form> tag just infront of the "action" attribute..
For eg.,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 17, 2007 May 17, 2007

Copy link to clipboard

Copied

LATEST
I do it a different way. I create an authorization key that I pass in a hidden form field and save as a session variable. Then upon form submission I check to see if the session auth key matches the form auth key. if not I bounce them somewhere.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation