Submit information to url, but also open PDF

Posted by Mad Ducky Digital Branding on Stack Overflow See other posts from Stack Overflow or by Mad Ducky Digital Branding
Published on 2012-04-05T02:43:56Z Indexed on 2012/04/05 17:31 UTC
Read the original article Hit count: 438

Filed under:
|
|
|
|

I have a client whose desire 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":

  1. execute the included MailChimp's javascript file; this ensures the form was properly filled, and then performs the sign-up to the newsletter list (don't need help with this part)
  2. then show the user an informational PDF for download or viewing EDIT: The logical order was flipped from when I originally posted this. The script should execute, and only if the script gets executed properly should the PDF show to the user

Note:

  • My experience level with HTML and PHP is 3/4, and with JS I am 2/4 EDIT: (seems more like 1/4 at this point lol). If my research is correct, PHP (server-side language) would be used to do that which the client wants.
  • Additional validation is not necessary beyond what MailChimp's script provides (it ensures that user has submitted a completed form) is not necessary in this case (the client says it's ok if the e-mail isn't valid at all). EDIT: Reworded this sentence from original post to be more clear
  • The .pdf URL and content is static, and simply needs to be shown, not generated.

----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*&amp;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..

----SOLUTION?---- ...

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript