handle form submission like a browser