Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to append querystrings to a URL on submit of a form?

Ok, so I have 2 forms on a clients website (website is built in wordpress).

The client is using Mail Chimp for his email marketing and has 2 forms set up in Mail Chimp to capture users data and subscribe them to two different lists.

I have 2 sections on the website with mini versions of these forms - The forms he has done in mail chimp are much bigger and require allot more details the ones I have on the site only have name, phone, email.

I have read an article on mail chimps blog that talks about how you can auto fill certain fields on the form on page load by adding the relevant query to the end of the url e.g. http:/FORMADRESS&MERGE1=Jack - this would pre-fill the "First Name" box on the form with the name Jack.

((http://blog.mailchimp.com/how-to-pre-fill-items-on-your-mailchimp-hosted-form/))

How can I add these query strings to the end of the URL in order to prefil the 3 fields from the mini form on the site on the large mail chimp form?

Any alternative solutions anyone is aware of would also be greatly appreciated.

Kind Regards,

like image 573
tomthorley Avatar asked Dec 04 '22 18:12

tomthorley


1 Answers

A form should do the trick, if I understand you correctly:

<form action="http://echo.iambroken.com/" method="get">
    <input name="one">
    <input name="two">
    <input type="submit">
</form>

Note that if there’s already a query string on the action URL, this will replace it — so if there are other parameters on the URL already, include them instead in the form as hidden inputs like this one:

<input type="hidden" name="q" value="123">
like image 88
s4y Avatar answered Dec 25 '22 04:12

s4y