The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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. Smile 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,

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. Smile Oh to have more time...

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
require_once($_SERVER['DOCUMENT_ROOT'] . "/admin/formtools/global/api/api.php");
$fields = isset($_SESSION["form_tools_form_data"]) ?
  ft_strip_tags($_SESSION["form_tools_form_data"]) : array();
$fields = ft_api_init_form_page(2);
$params = array(
  "submit_button" => "submit",
  "next_page" => "/events/entry-thanks.php",
  "form_data" => $_POST,
  "file_data" => $_FILES,
  "finalize" => true
    );
ft_api_process_form($params);
?>
And in the form, I have one field set like so:
Code:
<input type="text" id="contact" name="contact" value="<?=@$fields["contact"]?>" />
but it does not work unfortunately.

Dave