I have two input fields and a submit button (displayed inline). I'm trying to add a class to the next sibling after a input field is filled out. So if the first name input field is filled out, add a class to the email input field, if the email input field is filled out, add a class to the next input field and so on...
This is my code so far:
$('.form-display #mce-FNAME').blur(function() {
if($.trim(this.value).length) {
$('#mce-EMAIL').toggleClass('animated pulse');
}else if(...){ }...
});
My HTML looks like this:
<div class="form-display">
<div class="mc-field-group">
<label for="mce-FNAME">First Name </label>
<input type="text" value="" name="FNAME" class="" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address </label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
.animated.pulse
?