Mar 25th, 2015, 7:47 AM
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:
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!
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!