How does submit button work?