Auto Populate a form field onClick

I’ve taken on a web site with around 500 different email addresses included on different pages. When a visitor clicks the email address it opens up their email client to ssend a message. This only works if they use a local client but doesn’t work all the time.

I’ve been asked to create a form that will send the form content to the email address clicked.

The form will be the same for everyone who fills it in, the only special requirement is that the recipent will be the email address clicked.

In other words, is it possible to click an email link, have it open a form and have the form content sent to that clicked address.

Making 500 different forms doesn’t seem a good option!

Hope that makes sense.

Thanks for any ideas.

Hi, yes that’s definitely possible - but you will need a server-side technology like php to do some of the work.

You can pass parameters in a url via a query string e.g.
contact.php?email=markbrown4@gmail.com

On the contact.php page you can do something with that ‘email’ query string value like set the form submission to send an email to that address.

You would want to prevent it from being able to send to any email address though - so you either want to check the domain names or encrypt the data in the URL e.g.

contact.php?data=fh7Fmo2ruoamsd9&

And then you can decrypt that value with php and email it to that - this will prevent people from using your page as an email client or for spamming.

Hope it helps,