Created
November 30, 2012 14:05
-
-
Save makfruit/4175917 to your computer and use it in GitHub Desktop.
An HTML/Javascript snippet for Ecwid to clear billing form inputs after the 'My billing address is the same as shipping' checkbox is un-ticked
This file contains 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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script> | |
if (typeof(Ecwid) == 'object') { | |
// Add handler for Ecwid's OnPageLoad event | |
Ecwid.OnPageLoaded.add(function(page) { | |
if ('CHECKOUT_PAYMENT_DETAILS' == page.type) { | |
jQuery('.ecwid-AddressForm input[type=checkbox]').first().click(function() { | |
if (!this.checked) { | |
jQuery('.ecwid-AddressForm input[type=text]').val(''); | |
} | |
}); | |
} | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment