Skip to main content

Hello all, I am trying to pass a php variable as a value of hidden field.

Here is what I have: data-tf-hidden="case_id=<?php $CaseGUID ?>"

$CaseGUID is set to the GUID which is in the page url.

The idea is to capture the GUID to be saved with the form submission, so I can map it to a record in a SQL Server table.

The GUID is in the url as : ?case=9576A93E-E644-4D5B-971A-E99CC061D542

So I have also tried it this way: data-tf-hidden="case_id=case" and what gets passed to the hidden field is the word “case”, and not the GUID  value in the url.

 

I am not sure what I’m doing wrong, but nothing seems to work.

 

Hello @Silvio Ribeiro 

if you use code data-tf-hidden="case_id=case" then it will pass string “case” to your hidden field.

In PHP you should use a variable and print it out like this: 

data-tf-hidden="case_id=<?= $CaseGUID ?>"

Note the <?= tag, see #2 in PHP docs on PHP tags.


Thank you @mathio, you are awesome!

That worked perfectly.


Amazing, @Silvio Ribeiro! Don't forget to share your form and your use case with us! We'd love to take a look at it and give you some feedback! 😉
 

 


Reply