Created
February 7, 2013 15:43
-
-
Save jonathanselander/4731735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var callbackform = new VarienForm('callback-form', true); | |
jQuery('#callback-form button').click(function () { | |
if (!callbackform.validate()) { | |
return; | |
} | |
var phonenumber = jQuery('#phonenumber').val(); | |
var callbackdiv = jQuery('#callback'); | |
var loadingImage = "<?php echo $this->getSkinUrl('images/loading.gif'); ?>"; | |
callbackdiv.html('<img src="'+loadingImage+'" /> Sending...'); | |
jQuery.ajax({ | |
type: "POST", | |
url: "/bendart-callback/ajax/sendemail/", | |
data: 'phonenumber='+phonenumber, | |
success:function () { | |
jQuery('#callback').text('Thanks! We will be in touch soon.'); | |
} | |
}); | |
return false; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment