0

guys! Hope that you're having a marvelous day.

I have a "Schedule a demo" form on https://scalr.intl-l.com/ (right in the hero section)

When the client adds his email and clicks on "Schedule a Demo with a Solutions Engineer", the website should redirect him to https://get.scalr.com/demo-request/ and autofill his email in the "Business Email" field.

The question is: How can I capture his email with the form on homepage and autofill his email later on in the "request demo" form?

Thanks in advance!

1 Answers1

0

On the user entering his email you can redirect him to the page with javascript and add the parameters as GET parameters like this :

$(location).attr('href', 'https://get.scalr.com/demo-request?email=foo@bar.baz')

After that you can simply check if there is a '$_GET['email']' parameter set it in the input field like this:

<?php echo $_GET['email'] ? $_GET['email'] : ''; ?>

P.S. : Obviously for this way you will need jQuery. It's possible to do it with vanilla JS, check this for explanation.

Boian Ivanov
  • 164
  • 1
  • 3
  • 14