The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (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.27 (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.27 (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.27 (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.27 (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.27 (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 "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
How to check a file field in Submission Pre-Parser? - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16)
+--- Thread: How to check a file field in Submission Pre-Parser? (/showthread.php?tid=5103)



How to check a file field in Submission Pre-Parser? - garof - Mar 25th, 2015

Hi,
I have a FormTools form with 2 file fields, named "PhotoMain" and "PhotoAlt". I have added a text field on the form named "HasPhoto", which I would like to automatically indicate whether the user has added a file in any of the 2 file fields or not.

I thought of using the submission pre-parser with the following code:
Code:
if ($_POST["form_tools_calling_function"] == "ft_update_submission")
{
  if  (isset($_POST["PhotoMain"]) ||
  isset($_POST["PhotoAlt"]))
  {
  $_POST["HasPhoto"] = "Y";
  }
  else
  {$_POST["HasPhoto"] = "N";
  }
}

but that seems to do nothing when an entry is updated. I have also tried to use empty() instead of isset() without any success.

Could somebody help (even by pointing me to the right direction)?

Thanks!