Skip to content

Instantly share code, notes, and snippets.

@makfruit
Created November 30, 2012 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makfruit/4175917 to your computer and use it in GitHub Desktop.
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
<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