When users check the "My shipping address and billing address are the same" checkbox, I want to hide the shipping address form.
This code works well in everything except IE:
$("#order_shipping_same_as_billing").change(function() {
$("fieldset.shipping").toggle("blind", { 'direction' : 'vertical' }, 50);
});
IE doesn't register the change event until the checkbox loses focus, which makes for an unpleasant user experience.
Many shopping sites (and non-shopping sites!) do stuff like this -- there must be a cross-browser compatible method that I'm missing.
I usually use the click event for checkboxes instead of change. That way it works in IE as well.
$("#order_shipping_same_as_billing").click(function() {
$("fieldset.shipping").toggle("blind", { 'direction' : 'vertical' }, 50);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With