Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Is it possible to apply InertiaJS form helper in a usual modal form ?

Hello,

I'm happy because I now really understand how InertiaJS works, but some parts are not very clear in my mind yet.

https://inertiajs.com/forms

Is it possible to use the form helper with a usual modal form ?

(I have already asked here how it is possible to use modal form and I won't use any package to use InertiaJS modal form, I will just use usual modal windows, in my case with Element-Plus framework)

form.post(url, options)

Effectively if I use this request, is it possible to refresh only the initial loaded page (for example a table with a users list, so refresh the table with the new addd user), that means refresh it from the controller ?

Thanks for your help.

Vincent

0 likes
6 replies
tykus's avatar

Do you mean you want to refresh the page under the modal, or the modal contents specifically?

1 like
vincent15000's avatar

UPDATED

@tykus I mean I want to refresh the content under the modal and not the modal itself, this after having stored of updated the datas (post / put request).

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@vincent15000 That should be possible by using only: ['foobar'] and preserveState: true

1 like
vincent15000's avatar

@tykus Sorry it's a mistake, I want to know if it is possible to refresh the page under the modal and not the modal itself. And my modal is not a Page on its own.

vincent15000's avatar

@Sinnbeck I have updated a comment to answer @tykus in fact I has to refresh the page under the modal.

So my question is : is it possible to use the InertiaJS form help to handle a modal form (not a real InertiaJS page) and then refresh only the page under the modal.

As the post is handle server side via a controller, that means that the controller method which manage the post request should be able to run the code of another method (in the same controller) to refresh the page under the modal.

Please or to participate in this conversation.