u gt 'some' options
either use AJAX so the refresh doznt matter at all
or put the script in another page, i mean when data is submitted, the user is redirected to another page or redirected to the same page