handle form submission with overlaid mode