Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function(){
- $('#contactform').submit(function(){
- var action = $(this).attr('action');
- $('#submit').attr('disabled','disabled').after('<img src="contact-form/assets/ajax-loader.gif" class="loader" />');
- $("#message").slideUp(750,function() {
- $('#message').hide();
- $.post(action, {
- name: $('#name').val(),
- email: $('#email').val(),
- phone: $('#phone').val(),
- comments: $('#comments').val(),
- verify: $('#verify').val()
- challengeField: $("input#recaptcha_challenge_field").val();
- responseField: $("input#recaptcha_response_field").val();
- },
- function(data){
- document.getElementById('message').innerHTML = data;
- $('#message').slideDown('slow');
- $('#contactform img.loader').fadeOut('fast',function(){$(this).remove()});
- $('#submit').removeAttr('disabled');
- if(data.match('success') != null) $('#contactform').slideUp('slow');
- // 2 functions added by TrueThemes
- if(data.match('success') != null) $("html,body").animate({
- scrollTop: $("#message").offset().top
- }, 1000, function(){
- //scroll complete function
- });
- if(data.match('success') == null) $("html,body").animate({
- scrollTop: $("#message").offset().top
- }, 1000, function(){
- //scroll complete function
- });
- }
- );
- });
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement