Subscribe Form

'); }, success: function(response){ var response = jQuery.parseJSON(response); if(response.markedAsSpam){ jQuery('#origincode-contact-wrapper_1').find('.origincode_button_overlay').css('display','none'); var buttonField=response.spamButton; jQuery('#origincode-contact-wrapper_1 .origincode-error-message').empty(); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label').removeClass('error'); document.getElementById("origincode_contact_form_1").reset(); var buttonsHeight=jQuery('#origincode-contact-wrapper_1').find('div[rel="'+buttonField+'"]').height()+3; var buttonsWidth=jQuery('#origincode-contact-wrapper_1').find('div[rel="'+buttonField+'"]').width()-2; var spamText=response.markedAsSpam; jQuery('#origincode-contact-wrapper_1').find('div[rel="'+buttonField+'"]').empty().append(''+spamText+''); }else if(response.errors){ jQuery('#origincode-contact-wrapper_1').find('.origincode_button_overlay').css('display','none'); if(captchaExists=='yes'){ grecaptcha.reset(recaptchas[1]); } jQuery('#origincode-contact-wrapper_1 .origincode-error-message').empty(); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label').removeClass('error'); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label>em.required-star').removeClass('error'); jQuery.each( response.errors, function( key, value ) { jQuery('#origincode-contact-wrapper_1').find('div [rel="'+key+'"]').find('span.origincode-error-message').append(value); jQuery('#origincode-contact-wrapper_1').find('div [rel="'+key+'"]').find('label').addClass('error'); jQuery('#origincode-contact-wrapper_1').find('div [rel="'+key+'"]').find('label>em.required-star').addClass('error'); }); }else if(response.success){ if(response.afterSubmit=='print_success_message'){ jQuery('#origincode-contact-wrapper_1').find('.origincode_button_overlay').css('display','none'); var buttonField=response.buttons; var successText=response.success; var buttonsHeight=jQuery('#origincode-contact-wrapper_1').find('div[rel="'+buttonField+'"]').height()+3; var buttonsWidth=jQuery('#origincode-contact-wrapper_1').find('div[rel="'+buttonField+'"]').width()-2; jQuery('#origincode-contact-wrapper_1').find('div[rel="'+buttonField+'"]').empty().append(''+successText+''); document.getElementById("origincode_contact_form_1").reset(); jQuery('#origincode-contact-wrapper_1 .origincode-error-message').empty(); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label').removeClass('error'); }else if(response.afterSubmit=='refresh_page'){ jQuery('#origincode-contact-wrapper_1').find('.origincode_button_overlay').css('display','none'); location.reload(); }else if(response.afterSubmit=='go_to_url'){ jQuery('#origincode-contact-wrapper_1').find('.origincode_button_overlay').css('display','none'); document.getElementById("origincode_contact_form_1").reset(); jQuery('#origincode-contact-wrapper_1 .origincode-error-message').empty(); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label').removeClass('error'); var redirectUrl=response.afterSubmitUrl; window.location.href=redirectUrl; } } } }); } }); jQuery( "#origincode_contact_form_1" ).on( "reset", function() { if(captchaExists=='yes'){ grecaptcha.reset(recaptchas[1]); } jQuery('#origincode-contact-wrapper_1 .origincode-error-message').empty(); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label').removeClass('error'); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('label>em.required-star').removeClass('error'); jQuery('#origincode-contact-wrapper_1').find('.origincode-field-block').find('.stateWrap select option').remove(); }); function origincode_refresh_captcha() { captchacontainer=jQuery(this).closest('.formsAboveAlign'); img=captchacontainer.find('img').eq(0); captchaid=jQuery(this).attr('data-captcha-id'); var d = new Date(); time = d.getTime(); jQuery('.origincode_captcha_refresh_button').attr('data-time',time); formid=jQuery(this).data('form-id'); digits=jQuery(this).data('digits'); user='user'; img.remove(); var url='https://educationforallinindia.com/wp-admin/admin-ajax.php'; jQuery.ajax({ type: 'POST', url: url, data:{ captchaid: captchaid, action: "origincode_refresh_simple_captcha", time: time }, beforeSend: function(){ }, success: function(response){ newimg=''; jQuery(newimg).prependTo(captchacontainer); } }); } jQuery('#origincode_contact_form_1 .origincode_captcha_refresh_button').click(origincode_refresh_captcha); }) }