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
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
Validation clearing all data! - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: Validation clearing all data! (/showthread.php?tid=2956)



Validation clearing all data! - geekkeeg - Mar 13th, 2014

Hello all. I've got some validation on my form and it works beautifully. Problem is that every time there's an error, the data is not retained in the form, causing the users to have to re-enter it every time.

Here's my pertinent code:
<?php
require_once("/wamp/www/ah/global/api/api.php");
$fields = ft_api_init_form_page(5, "live", "form5");

$errors = array();
if (isset($_POST["submit"]))
{
$rules = array();
$rules[] = "if:element_27!=,required,element_57,Please enter misc details.";
$errors = validate_fields($_POST, $rules);

$criteria = array(
"col_2" => $_POST["element_1"],
"col_1" => $_POST["element_22"]
);
if (!ft_api_check_submission_is_unique(5, $criteria, $fields["form_tools_submission_id"]))
{
$errors[] = "Sorry, you have already placed a submission for this date range. Please contact the appropriate staff to modify your previous entry.";
}

if (empty($errors))
{
$params = array(
"namespace" => "form5",
"submit_button" => "submit",
"next_page" => "thankyouhims.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
}
else
{

$fields = array_merge($_SESSION["form_tools_form"], $_POST);
}
}
?>


Help!


RE: Validation clearing all data! - Joe - Mar 20th, 2014

In the markup on your form are you outputting the values?

For example:

<input type="text" name="firstname" size="25" maxlength="50" value="<?php echo htmlspecialchars($fields['firstname'])?>" />

Cheers,

Joe


RE: Validation clearing all data! - geekkeeg - Mar 24th, 2014

Nope! I'll give that a shot and report back.

Thanks!


RE: Validation clearing all data! - geekkeeg - Mar 25th, 2014

Totally worked. Thanks!


RE: Validation clearing all data! - Joe - Mar 25th, 2014

No worries!

Cheers,

Joe