Posts Tagged ‘type’

I ran into this unexpected problem when pressing the Enter key from within fields on certain forms in an Angular application. The short answer is to add a type=”button” attribute to any buttons that aren’t explicitly intended for form submission.

At first, I thought it was something specific to Kendo UI, but after doing a little more research, I stumbled upon this post, whose accepted answer addressed the problem perfectly. Thanks to S.O user Catsbergers for the solution.

Evidently, the default behavior may vary across browsers when no type is specified, so it should be a best practice to include one.