Skip to content

Instantly share code, notes, and snippets.

@FinalDestiny
Created January 4, 2018 09:37
Show Gist options
  • Select an option

  • Save FinalDestiny/267ee5f2621c998188e7e2d5c13ad087 to your computer and use it in GitHub Desktop.

Select an option

Save FinalDestiny/267ee5f2621c998188e7e2d5c13ad087 to your computer and use it in GitHub Desktop.
<script>
jQuery( document ).ready(function() {
jQuery(".et_bloom_submit_subscription").click(function(){
var form = jQuery(this).parent(), error = 0;
var name_val = form.find(".et_bloom_subscribe_name input").val();
if(name_val.trim() == '') {
form.find(".et_bloom_subscribe_name input").addClass('et_bloom_warn_field');
error = 1;
} else {
form.find(".et_bloom_subscribe_name input").removeClass('et_bloom_warn_field');
}
var name_val = form.find(".et_bloom_subscribe_last input").val();
if(name_val.trim() == '') {
form.find(".et_bloom_subscribe_last input").addClass('et_bloom_warn_field');
error = 1;
} else {
form.find(".et_bloom_subscribe_last input").removeClass('et_bloom_warn_field');
}
var email_val = form.find(".et_bloom_subscribe_email input").val();
if(email_val.trim() == '') {
form.find(".et_bloom_subscribe_email input").addClass('et_bloom_warn_field');
error = 1;
} else {
form.find(".et_bloom_subscribe_email input").removeClass('et_bloom_warn_field');
}
if(error === 1) return false;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment