Skip to main content
Answered

The URL address where the form was filled out in hidden fields

  • 15 January 2024
  • 1 reply
  • 46 views

Hi, I would like to have the exact webpage address automatically passed to hidden fields when filling out the form on my website.

In another thread, I found this code:

<div id="tf"></div>
<link rel="stylesheet" href="//embed.typeform.com/next/css/widget.css" />
<script src="//embed.typeform.com/next/embed.js"></script>
<script>
  window.tf.createWidget('<form-id>', {
    container: document.getElementById('tf'),
    hidden: { url_form: window.location.href }
  });
</script>

This code works, but it's just a regular embed in the content, and I would like the form to be embedded in a slider version. Here is my code for my slider version of the form:

<div data-tf-live="01HM2CYB1HZV6VWWG3XYTK4K7D"></div><script src="//embed.typeform.com/next/embed.js"></script>

Could someone help me and provide me with the code that will collect information about the URL of the page where the form was filled out?

Thank you in advance for your help! :)

Best answer by jeremielp

In the code you pasted, replace:

window.tf.createWidget

By:

window.tf.createSlider

Related doc: https://www.typeform.com/developers/embed/vanilla/#embed-types

View original

1 reply

Forum|alt.badge.img+5
  • Community Wizard
  • 127 replies
  • Answer
  • January 15, 2024

In the code you pasted, replace:

window.tf.createWidget

By:

window.tf.createSlider

Related doc: https://www.typeform.com/developers/embed/vanilla/#embed-types


Reply