I have added a Fontawesom spinner to the Mailchimp Submit Button and it works fine.
function addFaIcon(){
var i = document.createElement('i');
i.className = 'fa fa-circle-o-notch fa-spin';
i.style= '.buttonload {background-color: transparent;border: none;color: white;padding: 12px 24px;font-size: 16px;} ';
var FNAME_empt = document.forms["mc-embedded-subscribe-form"]["FNAME"].value;
var EMAIL_empt = document.forms["mc-embedded-subscribe-form"]["EMAIL"].value;
var MMERGE6_empt = document.forms["mc-embedded-subscribe-form"]["MMERGE6"].value;
if($('#mce-success-response').css('display') === 'none' && FNAME_empt != "" && EMAIL_empt != "" && MMERGE6_empt != ""){
document.getElementById('mc-embedded-subscribe').appendChild(i);
}
}
The problem is this spinner will be added to the submit button even if the Email field is not correct and doesn't have '@' or '.com'. So, How can i add a condition for this Email field to work the correct way?
Also, Mailchimp will add an Inline error message if the field isn't correct :
<div for="mce-EMAIL" class="mce_inline_error" style="display: block;">This field is required.</div>
Can i use this line of code for my Issue?
Thanks