Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mailchimp Multiple Subscription Forms for one list

I embedded three different customized mailchimp forms in an html page that point to one list (each form has two similar fields and one different hidden field).

Everything works excluding one thing. The responses messages (success or error) are displayed in the same page in the div #mce-response only for the first form. In the other two the responses are loaded and displayed in another blank page. I'd like to have the reponses displayed in the same page for all the three forms. I'm not a Java Script user but after a bit of research I found that this deals with the external script:

<script type='text/javascript' src='http://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>

Is there any solution through mailchimp settings or we have to use JavaScript file?

I understood that this script is valid only for the first form. Any idea how to do this? Thanks

like image 442
collideorscape Avatar asked Sep 30 '22 03:09

collideorscape


1 Answers

Apparently using iframes works.

Please refer to this article/video.

Text from the article for explanation:

Instead of pasting the code from the Signup Form Embed Code page into your site, paste it into a text document (using NotePad (PC) or TextEdit (Mac)) and call it “signup-form.html” or something like that. You may want to wrap the form in a div for styling and add some inline styles. So the HTML document will look something like this:

<style type="text/css">
<!--
lots of CSS to make your form look pretty
//-->
</style>

<div id="sign-up">
at least 50 lines of code copied from MailChimp goes here
</div>

Then upload this HTML document (“signup-form.html” or whatever you called it) to somewhere on your server.

Then in order to embed the code on the page (as many times as you want) you call the HTML in with an iframe like this:

<iframe src="http://your-site.com/mailchimp-form.html" frameborder="0" width="654" height="200">
<a href="http://link-to-form-on-mailchimp-site" target="_blank">Anchor text saying "click here to sign up" or something like that for people whose browsers can't read iframes</a>
</iframe>
like image 121
K.K Avatar answered Oct 01 '22 19:10

K.K