Jul 20th, 2009, 10:49 AM
I'm setting up a test installation of FormTools 2, and all basic functionality is working as intended.
However, I'm running into an issue with implementing reCAPTCHA on a form. I'm following the instructions here:
http://docs.formtools.org/tutorials/post...page=index
Everything is working (the reCAPTCHA is added to the form, it's getting processed when entered correctly, etc...except that when the form gets submitted, if the reCAPTCHA is incorrectly entered, the form seems to refresh itself and all previously-entered data is cleared out.
So, I added bits of code along the lines of those mentioned in step #3 (re-entering fields), but no luck...nothing seems to happen.
Looking at the source code of the form after a submission of this type, it appears that any of the text fields that are supposed to be populated by this code (with the [] portion of the $fields section updated to reflect the field's name in my particular form):
<input type="text" name="first_name" value="<?=htmlspecialchars(@$fields["first_name"])?>" />
are instead coming in with null values (value="")
Similarly, the select fields that are supposed to be populated by this code (again, with the [] portion of the $fields section updated to reflect the field's name in my particular form)
<?php if ($fields["age"] == "Under 18") echo "selected"; ?>
are defaulting the initial entry in the select list as being "selected", regardless of which item was chosen prior to form submission.
And, I'm not seeing any error message or anything, despite the code for that being (supposedly) in place.
My FormTools 2 installation is completely up-to-date as of this afternoon, my server meets/exceeds all requirements, and I have updated my config.php with my reCAPTCHA info and whatnot.
Like I said earlier, the reCAPTCHA works fine if I enter it correctly...the form gets processed and I get an e-mail summarizing the submission as expected. It's only when the reCAPTCHA is entered incorrectly that things get a bit...wonky.
Any help would be greatly appreciated.
Thanks,
Doug Thompson
Manager of Web and Electronic Communications
Ohio Wesleyan University
However, I'm running into an issue with implementing reCAPTCHA on a form. I'm following the instructions here:
http://docs.formtools.org/tutorials/post...page=index
Everything is working (the reCAPTCHA is added to the form, it's getting processed when entered correctly, etc...except that when the form gets submitted, if the reCAPTCHA is incorrectly entered, the form seems to refresh itself and all previously-entered data is cleared out.
So, I added bits of code along the lines of those mentioned in step #3 (re-entering fields), but no luck...nothing seems to happen.
Looking at the source code of the form after a submission of this type, it appears that any of the text fields that are supposed to be populated by this code (with the [] portion of the $fields section updated to reflect the field's name in my particular form):
<input type="text" name="first_name" value="<?=htmlspecialchars(@$fields["first_name"])?>" />
are instead coming in with null values (value="")
Similarly, the select fields that are supposed to be populated by this code (again, with the [] portion of the $fields section updated to reflect the field's name in my particular form)
<?php if ($fields["age"] == "Under 18") echo "selected"; ?>
are defaulting the initial entry in the select list as being "selected", regardless of which item was chosen prior to form submission.
And, I'm not seeing any error message or anything, despite the code for that being (supposedly) in place.
My FormTools 2 installation is completely up-to-date as of this afternoon, my server meets/exceeds all requirements, and I have updated my config.php with my reCAPTCHA info and whatnot.
Like I said earlier, the reCAPTCHA works fine if I enter it correctly...the form gets processed and I get an e-mail summarizing the submission as expected. It's only when the reCAPTCHA is entered incorrectly that things get a bit...wonky.
Any help would be greatly appreciated.
Thanks,
Doug Thompson
Manager of Web and Electronic Communications
Ohio Wesleyan University