Pass form entries from one page to another

I’m attempting to create a 2-stage form, so that if people get bored halfway through I’ve still got their name and phone number.

Is there a way, perhaps using hidden fields, to link one form to another, or is there a cleverer way to do it?

Thanks,

Simon

Share link: Webflow - Lyvly

1 Like

I don’t have exactly the same need, but in general want to figure out how to pass form data INTO webflow pages. Any ideas, anybody?

1 Like

I did find this previous article that may help; it inputs the URL, but you could use it to include anything if you can encode it within the URL first.

Use local storage to set values of the inputs and then on the next page pull in the input values.
updateHTML(); is on target page.
On target page target the id of the text or div or whatever then .innerHTML to place value in there.

Like so:

function getName() {

  return localStorage.getItem("userName");

  

}

function updateHTML() {

  var tents = getTents();

  var name = getName();

  var adults = getAdults();

  document.getElementById("io").innerHTML = adults;

}

function myFunction() {

  // Gets input value

  var tents = document.getElementById("Radio-8").value;

  var location = document.getElementById("Radio-7").value;

   var dateselected = document.getElementById("Date").value;

   var adults = document.getElementById("Adults-Item").innerHTML;

   var children = document.getElementById("Children").value;

   var infants = document.getElementById("Infants").value;

   var email = document.getElementById("email").value;

   var adultss = adults.toString();

   var childrens = children.toString();

   var infantss= infants.toString();

   

  // Saves data to retrieve later

  localStorage.setItem("email", email);

  localStorage.setItem("location", location);

  localStorage.setItem("tents", tents);

  localStorage.setItems("dateselected", dateselected);

  localStorage.setItems("adultss", adultss);

  localStorage.setItems("childrens", childrens;

  localStorage.setItems("infantss", infantss);

  localStorage.setItems("email", email);

  // Updates HTML

  updateHTML();

}
1 Like