Skip to content

use modal in form action? #458

Answered by edmundhung
stimw asked this question in Q&A
Feb 15, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You can put a submit button in the model and use the form attribute to associate it with the form, e.g.

// In the component
const [form,fields] = useForm();

// In the dialog
<button form={form.id}>Confirm</button>

If it is hard to pass the id down, you can always hard code it as long as it is unique.

// In the component
const [form,fields] = useForm({
  id: 'example',
});

// In the dialog
<button form="example">Confirm</button>

Replies: 1 comment 1 reply

Comment options

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

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