This should eliminate the problem of the page either refreshing and erasing all the fields or if you supplied an action="?" to another page it will stop it from loading that page.
Hope this helps.
© 2015, O’Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.