Skip to content

Form actions with modals #2692

Answered by H0R5E
H0R5E asked this question in Q&A
May 28, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi @Sarenor, thanks for the quick reply!

Usually, we recommend to try to stay away from modals

Oh, that's not super clear from the docs. I've used a lot of them! You'd recommend using a separate page for every form, instead?

use them with exact paths, so

So, after trying your recommended fix, I realised I had made a silly error. The buttons in the example form are inside the footer tags, which are outside of the form, so of course they didn't trigger the form actions...

OLD:

...
</form>
<footer class="modal-footer {parent.regionFooter}">
  <button class="btn {parent.buttonNeutral}" on:click={parent.onClose}>{parent.buttonTextCancel}</button>
  <button class="btn {parent.buttonPositive}"

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@H0R5E
Comment options

Answer selected by H0R5E
@Sarenor
Comment options

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