AlessandroCagliostro said:
I know how to do with with plain PHP ....
Unfortunately, there is NO WAY to do it in pure PHP. But heads up, there's still a way.
You will have to use javascript for this kind of work. You can create an onChange event on your select and the event should trigger a form submission.
Note: This will provide a horrible user experience as the page will reload after changing the dropdown. But if that's okay, then there's no problem.
It kind of sounds like you might be able to get away with a nested / hierarchical select menu, depends on what kind of data is being displayed in the corresponding div. You can use "optgroup" for this, or if it's more complex there's always select 2.
http://ivaynberg.github.io/select2/
If the data is not something applicable for a hierarchy inside a select, like already mentioned you'll need to use the on change event or something along those lines. You could have the subsequent sections all loaded by default and just dynamically hide / display the related section when the select changes.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community