So what I am doing to when the user clicks submit it does the check form. If that comes back with no validation issues the form opens a popup window that does some printing. On the popup page I have onload function that the confirmPrint function on the parent page to open up a modal window to ask if the pages printed properly. When the modal window closes I am calling the loaddata function to reload the page data. If the user does some other things on the main page the click submit and if the validation fails a blank tab opens. This is happening because I changed the form target to the formpopup. Is there a way I can change the form target back to what it was before.

with this I am getting js error saying "Uncaught ReferenceError: Invalid left-hand side in assignment"
and quite a few more things in the loaddata and the checkform function and I can't get anything to work properly.