I currently have a PHP page in which there a couple of div elements and a listbox. Also, im getting certain data from a database using PHP. I want to be able to modify the text area of the div elements based on the list box selection using PHP. Any ideas on how to do that ?
Share
With PHP alone you can’t, because it is a server-side script and so when the page reaches the client it cannot be edited via php.
You can load every possible div into the client page and hide all except one (the default one) and then show/hide the appropriate div based on the list box selection, but you do need JavaScript (or similar) language for this
PHP: Server-side script (no access to client input except from form submissions!)
JavaScript: Client-side script (can react to user input and events)