Contact Us text Contact us Name: Email: Please use a REAL email address so that we can get back to you. Subject: Message: We have read and agreed with Terms of use and privacy policy(*) Send Email function JAQC_submit() { console.log('= SUBMIT FORM ='); jQuery('.g-recaptcha').off().on('click', function(){ JAQC_submit(); }); jQuery('#ac-submit').trigger('click'); } jQuery(document).ready(function($){ var maxchars = 1000; var captcha = 0; var cpversion = ''; var emailabel = 'Email'; var senderlabel = 'Name'; var messagelabel = 'Message'; var el = $('#ac-submit'); el.on('click', function(e) { var email = $('#contact_email').val(); var ck=true; var errors = $('.error'); if (!errors || errors.length>0) { errors.removeClass('error'); } var regex=/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/; if(!regex.test(email)) { if((email=='')||(email==emailabel)) { $('#error_email').html('Please input your email!'); } else { $('#error_email').html("Your email is invalid!"); } $('#row_email').addClass('error'); ck=false; } else { $('#error_email').html(''); } var name = $('#contact_name').val(); if((name=='')||(name==senderlabel)) { $('#error_name').html('Please fill in your name!'); $('#row_name').addClass('error'); ck = false; } else { $('#error_name').html(''); } var subject = $('#contact_subject').val(); if(subject=='') { $('#error_subject').html("Subject can not be null"); $('#row_subject').addClass('error'); ck = false; } else { $('#error_subject').html(''); } var termandcondition = $('#term_condition').prop('checked'); if(!termandcondition) { $('#error_term_condition').html("You Must Accept Terms and Conditions"); $('#row_term_condition').addClass('error'); ck = false; } else { $('#error_term_condition').html(''); } var message = $('#contact_text').val(); if((message.length>maxchars) ||(message.length < 1)||(message==messagelabel)) { $('#error_text').html('Number of characters cannot be less than 5 or greater than1000'); $('#row_text').addClass('error'); ck = false; } else { $('#error_text').html(''); } if(captcha) { if (cpversion === 'recaptcha' || cpversion === 'invisible') { var response = grecaptcha.getResponse(); //recaptcha failed validation if (response.length == 0) { $('#error_captcha_code').html("Input your captcha"); ck = false; } else $('#error_captcha_code').html(""); } else { if ($('#captcha_code').length){ var captcha_code = $('#captcha_code').val(); if((captcha_code=='')||(captcha_code=='Type the code shown')) { $('#error_captcha_code').html("Input your captcha"); ck = false; } else { $('#error_captcha_code').html(''); } } else if($('#recaptcha_response_field').length) { var captcha_code = $('#recaptcha_response_field').val(); if((captcha_code=='')||(captcha_code=='Type the code shown')) { $('#error_captcha_code').html("Input your captcha"); ck = false; } else $('#error_captcha_code').html(""); } else if ($('#mathguard_answer').length) { var captcha_code = $('#mathguard_answer').val(); if((captcha_code=='')||(captcha_code=='Type the code shown')) { $('#error_captcha_code').html("Input your captcha"); ck = false; } else { $('#error_captcha_code').html(""); } } } } if(ck) { $("#ja_quicks_contact").submit(); } return ck; }); });