If you've added custom jQuery or javascript code to your checkout page, you may have noticed that when the page updates (such as a form changing, etc) some of the effects of your script can be lost.
This is because the One Page Checkout uses ASP.NET update panels. These will reload a section of the page via AJAX and will update an entire section of HTML. This happens in areas such as the Address Area, Shipping Area, Payment Area, or even the whole page.
In order for your scripting to continue working after these update, you'll need to add your code to the "Page Request Manager". This way it can run again after the HTML has updated.
The following code can be used as a skeleton for you to insert your code into. Put any custom code you want to run inside the "OnePageCheckout_EndRequestHandler" function.
<script>
function OnePageCheckout_EndRequestHandler(sender, args) {
}
$(function() {
var prm = Sys.WebForms.PageRequestManager.getInstance();
OnePageCheckout_EndRequestHandler();
if (OnePageCheckout_EndRequestHandler) {
prm.add_endRequest(OnePageCheckout_EndRequestHandler);
}
});
</script>