Ads

Sunday, 20 July 2014

Formchimp - jQuery MailChimp ajax plugin

Download   Demo


Formchimp is a customizable MailChimp ajax plugin for jQuery, provides an easy and lightweight way to let your users sign up to your MailChimp list.


Features


  • Customizable Error and Success messages.

  • Ability to specify which element the output should be appended to, if it exists or where the element should be created

  • Automatically transforms the mailchimp signup url in the JSONP format

  • Changes the value of the button if the response is successful

  • This solution is language agnostic, only dependency is jQuery.

  • is AJAX-enabled, but degrades gracefully if Javascript isn’t turned on

  • Multiple sign-up forms, for multiple lists.

1. INCLUDE JS FILES


<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="jquery.formchimp.js"></script>

2. HTML


<form action="ADD MAILCHIMP URL">
<label for="email">Email*:</label>
<input id="email" name="ADD MAILCHIMP NAME ATTRIBUTE" type="email" value="" />
<button type="submit" value="Subscribe">Subscribe</button>
</form>

3. JAVASCRIPT


$(".form-class").formchimp();

4. OPTIONS


appendElement:


Selector: Declare where the new element, containing the messages from Mailchimp will be appended to.


Default: $(this)


buttonText:


String: The message to be written on the submit button after a successful subscription.


Default: ”


errorMessage:


String: Set custom error message given when return an error.


Default: ”


responseClass:


Selector: Declare custom element in page for error output.


Default: mc-response


successMessage:


String: Set a custom success message.


Default: ”


url:


String: The mailchip list subscription url, to get the JSONP address just change post to post-json and append &c=? at the end.


Default: form action attribute



Formchimp - jQuery MailChimp ajax plugin

No comments:

Post a Comment