How to submit a form

Hi! Didn’t find any information or examples with submitting json form. There are forms from which it is impossible to take out the submit button (for example, the subscription form on the screen).
How to implement submit in this case?
Passing the handler callback as a prop through the context seems like some kind of wild overhead in terms of additional work on the form.

(I use react)

Hi @epustovaya,

You only need to escape JSON Forms via the React context mechanism in case you want to handle the callback outside of the form. If you have sufficient information already within the form then you can of course just handle it within your custom renderer.

In case you want to invoke the standard HTML submit behavior then you just need to render JSON Forms within a form and add the submit button within the form but outside of JSON Forms.

1 Like