Horizontal Mailchimp Signup Form
Add a horizontal mailchimp signup form with inline validation.
HTML
<link rel="stylesheet" href="http://aprettierweb.com/wp-content/themes/aprettierweb/includes/bootstrap/css/bootstrap.css?ver=3.8.1">
<div class="cta">
<div class="container">
<div class="row">
<div class="col-md-5 col-sm-6 content">
<h4>Don't Miss Out on <strong>Weekly Wordpress Videos</strong> and Monthly <strong>Freebies</strong></h4>
</div><!-- .col -->
<div class="col-md-7 col-sm-6">
<form action="http://aprettierweb.us3.list-manage1.com/subscribe/post?u=b35a9ad011269581965e50200&id=553e5d2942" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="form-inline validate" target="_blank" role="form" novalidate>
<div class="row">
<div class="col-xs-5">
<input type="text" value="" name="FNAME" class="form-control required" id="mce-FNAME" placeholder="First Name" />
</div>
<div class="col-xs-5 no-padding-left">
<input type="email" name="EMAIL" class="form-control required email" id="mce-EMAIL" placeholder="Email" />
</div>
<div class="col-xs-2 no-padding-left">
<div style="position: absolute; left: -5000px;"><input type="text" name="b_b35a9ad011269581965e50200_553e5d2942" value=""></div>
<button type="submit" class="btn btn-default" id="mc-embedded-subscribe">Submit</button>
</div><!-- .col-->
</div><!-- .row -->
</form>
</div><!-- .col-->
</div><!-- .row -->
</div><!-- .container -->
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none">
<div class="container">
<div class="row">
<div class="response-msg col-col-md-9 col-xs-12"></div>
</div>
</div>
</div>
<div class="response" id="mce-success-response" style="display:none">
<div class="container">
<div class="row">
<div class="response-msg col-md-9 col-xs-12"></div>
</div>
</div>
</div>
</div>
</div><!-- .cta -->
CSS
.cta { background-color: #fbfaf2; background-color: #8ed2c0; width: 100%; float: left; margin-bottom: 50px; }
.cta .content { margin-bottom: 0px; }
.cta h4 {font-family: Arial; text-transform: none; margin: 20px 0; color: #2d8d7e; font-weight: bold; font-style: italic; }
.cta h4 strong { color: #247064; }
.cta p { font-size: 15px; font-style: italic; color: #ff957e; }
.cta form { margin-top: 20px; }
.cta input{ background-color: #d5efe8; border-color: #c8e1da; }
.cta input.form-control::-webkit-input-placeholder { color: #81c5b3; font-style: italic; }
.cta input:focus::-webkit-input-placeholder { color: #81c5b3; text-align: right; }
.cta .form-group { vertical-align: middle; }
a.small-button, a.small-button:visited { font-size: 13px; width: 200px; text-decoration: none; border-radius: 30px;
background-color: #32c099; opacity: .99; vertical-align: center; line-height: 80px; color: #fff; padding: 10px 16px; margin-right: 8px; }
a.small-button:hover { opacity: 1; background: #5c5c5c; color: #fff; }
.form-control.mce_inline_error { border-color: #f95d23; }
#mce-responses .response { width: 100%; border-top: 1px dashed #ccc; padding-top: 18px; padding-bottom: 18px; float: left; }
#mce-success-response.response .response-msg, #mce-error-response.response .response-msg { font-family: Georgia, serif; font-style: italic; font-size: 16px; font-weight: bold; color: #777; color: #41CDA7; float: left; margin: 0 4px; min-height: 40px; }
#mce-error-response { background-color: #fb9e7b; }
#mce-success-response { background-color: #FBF9F0; }
#mce-success-response.response .response-msg { color: #3ec5a0; }
#mce-error-response.response .response-msg { color: #f95d23; padding-top: 4px; }
JavaScript
<!-- Mailchimp Validation -->
var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';
try {
var jqueryLoaded=jQuery;
jqueryLoaded=true;
} catch(err) {
var jqueryLoaded=false;
}
var head= document.getElementsByTagName('head')[0];
if (!jqueryLoaded) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
head.appendChild(script);
if (script.readyState && script.onload!==null){
script.onreadystatechange= function () {
if (this.readyState == 'complete') mce_preload_check();
}
}
}
var err_style = '';
try{
err_style = mc_custom_error_style;
} catch(e){
err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
}
var head= document.getElementsByTagName('head')[0];
var style= document.createElement('style');
style.type= 'text/css';
if (style.styleSheet) {
style.styleSheet.cssText = err_style;
} else {
style.appendChild(document.createTextNode(err_style));
}
head.appendChild(style);
setTimeout('mce_preload_check();', 250);
var mce_preload_checks = 0;
function mce_preload_check(){
if (mce_preload_checks>40) return;
mce_preload_checks++;
try {
var jqueryLoaded=jQuery;
} catch(err) {
setTimeout('mce_preload_check();', 250);
return;
}
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
head.appendChild(script);
try {
var validatorLoaded=jQuery("#fake-form").validate({});
} catch(err) {
setTimeout('mce_preload_check();', 250);
return;
}
mce_init_form();
}
function...