Skip to content

Implicit submission on forms #3252

Answered by SiTaggart
marcdevens asked this question in General
Discussion options

You must be logged in to vote

Hi @marcdevens

Absolutely! That would be our recommended approach as it's the most common and expected behaviour.

Our suite of applications are very mixed in their different approaches though, so we aren't enforcing anything on anyone, in favour of teams making explicit choices. We'd love every form to do this but understand a lot of old and legacy pages have limitations.

We think every form should be wrapped in a Form which provides the necessary HTML element. Form actions should be placed in the form itself. Here we require you to explicitly set the button type to be submit on the Button component.

All that is left then is adding a onSubmit event handler to the form where you can proces…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marcdevens
Comment options

Answer selected by loreina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants