Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 2 years ago.
0

Why didn't u just use Javascript/Ajax ?

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.