Skip to content

Instantly share code, notes, and snippets.

@jonathanselander
Created February 7, 2013 15:43
Show Gist options
  • Save jonathanselander/4731735 to your computer and use it in GitHub Desktop.
Save jonathanselander/4731735 to your computer and use it in GitHub Desktop.
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