First off, this is not the best way to do this. But if you’re not too concerned about aesthetics or the “right” way to do things (on the web, many ways exist to achieve a goal, so that’s a bit of a blanket statement), then this could help you out a lot.
So how to fix this?
The solution is remarkably simple. First off you modify your form so that the action is set to #null:
<form action=”#null” …>
document.getElementById(‘form_name’).action = “process_file.php”;