The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Captcha not using process.php - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Captcha not using process.php (/showthread.php?tid=1662) |
Captcha not using process.php - filch - Sep 28th, 2011 Ben, I was just adding a Captcha to a couple of forms and got to the point where I was testing the error messages and realized that all the previously filled out form fields were lost in a case where a person enters the wrong data in the Captcha Field and tries to submit. I then realized that in order to re-populate the form fields, you apparently must be using process.php rather than the API. Am I understanding this incorrectly and if so, how do I repopulate the form fields when using the API? Dave RE: Captcha not using process.php - Ben - Sep 28th, 2011 Hi Dave, For re-filling form fields when using the API, check out these tutorials: This one shows the PHP code you need at the top of the page: http://docs.formtools.org/tutorials/php_validation/index.php?page=add_validation This one shows how to actually re-fill each of the different field types: http://docs.formtools.org/tutorials/api_refilling_form_fields/ Re-filling the form fields actually works better with the API, because the data submitted by the user is always available to re-input in the fields. - Ben P.S. Boy I can't wait to finally get the Form Builder module released... all of the extra work you need to do to integrate your forms properly, plus all these nit-picky problems that arise from using the API will finally disappear. Oh to have more time... RE: Captcha not using process.php - filch - Sep 28th, 2011 (Sep 28th, 2011, 11:41 AM)Ben Wrote: Hi Dave, Yeah, time is definitely a problem. More like a currency and a luxury. Anyway, I remember trying this before with the Captcha stuff and not having any luck and nothing much has changed. I added just the one field for testing and if you enter an incorrect entry in the Captcha field the page refreshes and you lose the field entries irregardless of having the code in there. At the top, I currently have: Code: <?php Code: <input type="text" id="contact" name="contact" value="<?=@$fields["contact"]?>" /> Dave |