Mailchimp Multiple Subscription Forms for one list

拥有回忆 提交于 2020-01-03 13:08:59

问题


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


回答1:


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>



回答2:


Use Ajax Chimp. This will (1) prevent redirecting your subscribers away from your page and (2) allow multiple forms.

https://github.com/scdoshi/jquery-ajaxchimp



来源:https://stackoverflow.com/questions/27638972/mailchimp-multiple-subscription-forms-for-one-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!