FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check a file field in Submission Pre-Parser?
#1
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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)