The problem is the onsubmit event is actually at the same time as the submit, so the add to cart may not have happened before the modal is opened.
One solution might be to add an iframe into the modal div and submit the form targetting that iframe. That way the cart contents will be refreshed with the submit. Another option would be to use AJAX to submit and re-populate the modal div.