Page 1 of 1

pass a field from formbuilder to a udt

Posted: Sun Feb 13, 2022 2:40 pm
by janvl
Hi,

I have been trying to pass the value from a Formbuilder form inside a udt.

Like:
in the form i have a field - $fld60

I tried to pass this value as a parameter for UDT {convfdf2} like
{convfdf2 filename=$fld_60}

in the UDT
$filename = isset($params['filename']);

if i echo $filename i get a value of 1

I did read the manual on the webpage, searched in internet but i cannot find an answer.
I have "chained" forms from formbuiler where one can pass fieldvalues to a new form called in the confirmation, teh values get passed to the next form but i needed the value in the udt.

Regards,
Jan

[solved] Re: pass a field from formbuilder to a udt

Posted: Sun Feb 13, 2022 9:54 pm
by janvl
Hello

i probably should have avoided to call parameter and variable the same name.

I used exactly this example with the difference that i named the parameter "txtname" then it worked.

Regards,
Jan

Re: pass a field from formbuilder to a udt

Posted: Mon Feb 14, 2022 5:49 pm
by rotezecke
$filename = isset($params['filename']);

if i echo $filename i get a value of 1
isset() returns a boolean. so the "1" just means that the value is set. usually used in if statements. probably better is empty()

Code: Select all

if(!empty($params['filename']))
{
  $filename = $params['filename'];
}

Re: pass a field from formbuilder to a udt

Posted: Mon Feb 14, 2022 7:34 pm
by janvl
Thanks rotezecke

the filename is never empty because i produce it myself.

I have to extend the udt to convert the file from utf8 to iso8859-1. (the PDF's i got are iso8859-1)
Then merge this FDF-file with the proper PDF to a filled-out PDF that is send per mail.

Regards,
Jan