Submit form with dynamic content

Philip is freelancer

If you feel the content is useful. Thank for me with a coffee ๐Ÿ˜Š

December 09, 2021 10:12 am

How to add page content to form submission. It will be very helpful to know from which page of your website your customers submitted the form.

Steps:

1. On brizy cloud, create a new form - Create a field of type "hidden"

2. Add ID for "content you want to receive from the notification form"

3. Name the ID for the form

4. Add an embed code *

5. Save and run

CODE:

<script>

var outputValue = document.getElementById("content-test").textContent;

document.querySelector("#form-test input[type='hidden']").setAttribute('data-placeholder, outputValue);

</script>

If you want to get current link from message form.

Use javascript code:

<script>

var outputValue = window.location.href;

document.querySelector("#form-test input[type='hidden']").setAttribute('data-placeholder, outputValue);

</script>


If you feel the content is useful. Thank for me with a coffee ๐Ÿ˜Š