Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Layers #8

Open
pauloffb opened this issue Aug 25, 2022 · 1 comment
Open

Problem with Layers #8

pauloffb opened this issue Aug 25, 2022 · 1 comment

Comments

@pauloffb
Copy link

Hi, I've been trying to use unpoly with laravel, by replicating the unpoly demo app. But when I try to open a form in a new modal layer, on submit I cannot make it work properly.

On successfull form submit I want it to close the modal and update the root layer and on validation errors, I want it to show the errors inside the modal.

If I have this:
<form action="{{route('products.store')}}" method="post" up-submit >

The errors show up on modal, but on successfull submit the modal is kept open.

If I change it to:
<form action="{{route('products.store')}}" method="post" up-layer="parent" >

The modal is closed, which is OK on successfull submit, but the same happens when there are validation errors, because the form is now open in main layer.

Has anyone already done this?

@robinvdvleuten
Copy link
Member

When using up-submit, you can set a X-Up-Target header on the successful response to update an HTML fragment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants