close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

implementing a captcha to an existing form.

Thread began 7/24/2013 11:30 pm by khon_lao435659 | Last modified 8/20/2013 7:15 pm by khon_lao435659 | 1248 views | 9 replies |

khon_lao435659

implementing a captcha to an existing form.

I have created a website design site with a form to submit quotes that when submitted gets redirected to a thank you page to mail off the quote. now my problem is this form is submitted by spammers. i noticed with security assist we can add a captcha for a registration.php
now my question is, am i able to use a security assist to implement a captcha to an already built form to stop spammers?
what i need is, if they enter the captcha wrong it gives an error "please try again" on the form page. and once its been corrected it will be successfull and will submit to my thank you page.

thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

If you have Data Bridge you can add captcha to the form

to add the acptcha form element go to Webassist -> Forms -> Insert Captcha

your form should already have server validation applied to it, go to the Server Behaviors panel, and double click the Server Validation server behavior to edit it and add the Like Entry validation for the validation element.

Select the Like Entry Validation type, for the server variable, click the lightning bolt and select the captcha form element from the bindings panel, the click the plus button to add it to the validation list, for the comparison, click the lightning bolt icon and select the captcha session variable.

use the validation show if behavor to show the error message on validation failure.

Sign in to reply to this post

khon_lao435659

yes i do have data bridge, i will give that a go and get back to you :)

Sign in to reply to this post

khon_lao435659

there seems to be something wrong. i set it up like you instructed, but it doesnt work. validation trigger is button submit press. i choose the validation type was like entry and choose the captcha variable then added it and the same as field i choose the captcha. and for the fail redirect to the form page.

then added a validation show if for the text "please try again" applied it to my form page and the fail i selected the like entry captcha and clicked ok.

i tested it locally with xxamp but wont work. i dont get an error msg on submit and it will submit successfully regardless if the entered captcha was incorrect.

then i uploaded it to http://webimpact.com.au/test/quote.php same thing happens.. but now the captcha image does not work?

Sign in to reply to this post

Jason ByrnesWebAssist

the action of the form is set to post to the quote-thankyou.php page.

when working with forms, always keep the following rule in mind:

All Form Processing MUST occur on the page specified as the action.

in this case, you need to apply the server validation behavior to validate the captcha input on the quote-thankyou.php page.


see this page for more details on adding server validation:
http://www.webassist.com/tutorials/Add-server-validation-to-your-web-forms


as for the captcha image not showing up on the server, when i right click the captcha placeholder and selct open in a new tab, it brings me to a page not found error:
http://webimpact.com.au/test/webassist/captcha/wavt_captchasecurityimages.php?width=100&height=30&field=Security_Code_1&bgcolor=FFFFFF&transparent=0&bgimage=&gridfreq=20&gridcolor=000000&gridorder=behind&noisefreq=20&noisecolor=000000&noiseorder=behind&characters=5&charheight=&font=fonts/MOM_T___.TTF&textcolor=000000


this indicates that the files from the webassist/captcha/ folder have not been uploaded to the server.

Sign in to reply to this post

khon_lao435659

thanks for the lesson on form processing. sounds logic!
when the error shows up on my thank you page. they need to re submit the captcha, now the problem is when they click "back" to try it again, the form data needs to be re submitted. how do i have it so the data is saved so they do not need to fill out the form all over?

Sign in to reply to this post

Jason ByrnesWebAssist

On the bindings panel, there is a binding collection called validated entries.

Bind each of the form elements to the corresponding validated entries binding.


this is covered in the tutorial I linked to previously:
http://www.webassist.com/tutorials/Add-server-validation-to-your-web-forms

Sign in to reply to this post

khon_lao435659

I have implemented a recaptcha sucessfully. thanks for your help

i have a little problem with initial values. i can successfully bind validated entries for my text fields and list/select menus fine. but when it comes to check boxes. i am not able to give it a validated entry via the binding panel? i tried the properties inspector and gave it a dynamic source. for the check if field i choose the check box validated entries binding from the action page and the equal to field i copied the check if field. i tested the form and noticed now the check box is checked by default. and the original value is not there so that means i wont get my value emailed to me.

how do i bind my check boxes with the validated entries and be able to keep my check box value ?

hope that made sence.

Sign in to reply to this post

Jason ByrnesWebAssist

make sure the checkbox has a value, then in the dynamic settings, set the Check If section to use the Validated entire binding. In the Equal to section, enter the Checked Value

Sign in to reply to this post

khon_lao435659

thank you that worked perfectly. anotherr knowledge i have gained!

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...