0
display content based on select
It is possible to load content on page after selecting a select element in php or js? Like when I select a value to load something from the database and if I select the second one to soad something else, without using a framework like angular or vue?
1 Answer
0
Yes, that is possible.
Step 1: Create an HTML form with the select with your options
Step 2: In PHP you receive the options in the $_POST array. Then based on what the user chose, you send the appropriate content back to the user.
Step 3: For convenience I recommend using something called Ajax for this kind of thing.
With Ajax (Asynchronous Javascript And XML) the user doesn't have to wait untill the browser reloaded with the new content.
I hope my answer helped you into the right direction.