close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

User-entered field data lost if incorrect Captcha entered

Thread began 4/13/2011 3:15 pm by gail.bergan407744 | Last modified 4/19/2011 10:38 am by Jason Byrnes | 12430 views | 14 replies |

gail.bergan407744

User-entered field data lost if incorrect Captcha entered

Hi,

Is there a way, using CFSP, to retain entered data in additional form fields, if the incorrect Captcha or security question is entered? I've added Spry fields such as Address, City, State, Zip etc. to my contact form, and put them as Required. So you fill them in, but if you misread the Captcha image and it sends you back to the page, the additional fields are blank again. This is going to really annoy my visitors. Any solution for this?

Gail

Sign in to reply to this post

Jason ByrnesWebAssist

set the inital value for the for elements to use the following code:

php:
<?php echo(ValidatedField("contact","<elementName>")) ?>



where <elementName> is the name oif the form element.

so if you have a form element names Address, use:

php:
<?php echo(ValidatedField("contact","Address")) ?>
Sign in to reply to this post

gail.bergan407744

Thanks, that did the trick.

Your validation/error script seems to override the built-in Spry script...so that even if they don't fill one of my new fields in, as long as your 4 are filled in correctly, the email sends anyway. I tried copying the validation code from one of yours (such as Contact_Name field) so that they would get an error message if they did not fill in one of my new fields. I just got lots of ugly code on the page. I assume this won't work unless I have your FormBuilder?

Sign in to reply to this post

Jason ByrnesWebAssist

copying and pasting the code will not work in this way.

The spry validation should occur before any of the server validation, there should not be any conflict between the two.

can you send a link to your page where i can see the problem to investigate why the spry validation is not working.

Sign in to reply to this post

gail.bergan407744

Yes, thank you. Please go to contact.php to see what I am talking about.

Gail

Sign in to reply to this post

Jason ByrnesWebAssist

when i view you page in Fire Fox, fire bug is reporting multiple errors in the js/prototype.js file, these may be causing spry validation to not work properly.


it is also reporting an error with this code in the SpryAssets/SpryValidationTextarea.js


if (this.options.maxChars > 0 && this.input.value.length > this.options.maxChars){
return;
}


try deleting that code.

Sign in to reply to this post

gail.bergan407744

I've done a search on the source code of my contact page in DW, as well as in the browser, and can't find the lines you tell me to delete anywhere.

What is firebug and how do I access it?

Sign in to reply to this post

Jason ByrnesWebAssist

this code is in the SpryAssets/SpryValidationTextarea.js file, not on your contact page:

if (this.options.maxChars > 0 && this.input.value.length > this.options.maxChars){
return;
}

fire bug is an add on to firefox:
getfirebug.com/

Sign in to reply to this post

gail.bergan407744

OK, I found the line in the js and deleted it. The problem persists. What happens is that if I fill out a half-filled form (ignoring some of my added required fields), the "Required" message flashes on the screen for a second, then the email sends and I'm rerouted to the thank you page.

What would cause these javascripts to become corrupted? I'm not knowledgeable enough to have fiddled with them - I'm using them as-is from what DW provides. I sure would like to know where the errors are coming from.

Sign in to reply to this post

Jason ByrnesWebAssist

there are also error reported in the js/prototype.js file, remove the reference to that file.

the errors in the js/prototype.js file may be the cause of the problem in the SpryAssets/SpryValidationTextarea.js file.

javascript can sometimes be a house of cards, when one script starts causing errors, it will cause the other scripts on the page to faile.

if that does not work, you will need to begin stripping the page one piece at a time to find the problem.

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...