How can I display the response of a MailChimp form submit in a modal box instead of redirecting?

匆匆过客 提交于 2019-12-11 10:03:49

问题


I currently have a standard form for users on my site to signup for our mailing list:

<form class="form-stacked" action="http://coworkDF.us2.list-manage.com/subscribe/post" method="post">
<input class="span3" id="MERGE0" name="MERGE0" type="email" autocapitalize="off" autocorrect="off" placeholder="e-mail">
<input type="submit" class="btn float-right mail-send" value="Enviar">
</form>

Instead of redirecting them to the confirmation page, I'd love to display that confirmation in a modal box without leaving the page. I'm using the Twitter Bootstrap toolkit to build the site... they have a nice modal box utility but I'm not sure how to combine that with the MailChimp form.

Any thoughts? Thanks in advance


回答1:


Just in general terms, you need to submit the signup request via ajax so that you stay on the current page, then extract relevant pieces from the response and use them to populate your modal.



来源:https://stackoverflow.com/questions/7480682/how-can-i-display-the-response-of-a-mailchimp-form-submit-in-a-modal-box-instead

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