EDIT: This privately published page is what I need to work with. Password: stackOF
My client desires is to have her Wordpress blog show a MailChimp form on her home page as a gateway to a .pdf. I need the following behavior to occur when the user clicks "Submit":
Note:
----RESEARCH---- I know that the Mailchimp form uses the following line to actually submit the information, but I want to do the action mentioned below, as well as open the aforementioned .pdf:
<form action="http://*BLAH*.us2.list-manage.com/subscribe/post?u=*BLAHBLAH*&id=*BLAHBLAHBLAH*" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
I am reading on other sites that I can conceivably point "action" to a .php file, but if there is a way to do this with javascript - since its using the .js file that I created for that already anyways, then I would be most happy. Barring that, I'll take what I can get..
You can try the following:
add an onsubmit
handler on the mailchimp form like below:
<form onsubmit="runMyStuff(this)" action="http://*BLAH*.us2.list-manage.com/subscribe/post?u=*BLAHBLAH*&id=*BLAHBLAHBLAH*" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
Your javascript function:
function runMyStuff( o ) {
// open the pdf file in a separate window
window.open( PATH_TO_YOUR_PDF_URL );
// now, submit the form
o.submit();
}
Hope this helps.
Methinks I have more to learn about JS than I initially thought - Mad Ducky Digital Branding 2012-04-05 17:06
Where do I go from here - Mad Ducky Digital Branding 2012-04-05 18:46
http://careerchoiceswithlaura.us2.list-manage.com/subscribe/post?u=31b9cd9a27e00ab826a9049ff&id=15cd56bcda
, validate and then show the pdf to the user if everything is ok - web-nomad 2012-04-05 18:55
You might possibly create a page that includes your script and have an iframe that points to the URL of the PDF.