Pass values to hidden fields in lightbox form

  • 23 April 2016
  • 2 replies
  • 28 views

Hi,
I think the lightbox form is a great new feature.
BUT how do I access hidden fields to pass values from the main page to the form using javascript. The lightbox form seem to placed on another page.
Best regards
Lars


2 replies

Userlevel 7
Badge +3

Hi Lars, 

What kind of values are you looking to pass from the main page to the lightbox?

Currently, if your URLs are tagged with parameters, these would get passed to the form in the lightbox automatically (ex. UTM tags).

Best,
Hristian

Thanks for answering quickly.
My values are very custom. An example could be a string with “xx,yy,zz” to be placed in a hidden field in the form called e.g. “answers”. Or it could be anything else - it’s a generel question, because today I can place anything with javascript in a hidden field.
Of course it’s always convenient also to pass parameters…
Best regards
Lars
PS: A solution could be this, but it’s a lot more complex than it ought to be:

  • UrlEncode my values into additional parameters
  • Change the link to the lightbox to contain these parameters
  • Place a script in the lightbox to unpack the parameters and UrlDecode them
  • Let the script add it to a hidden field in the form on the lightbox page…

Reply