dropdown onchange method using php and javascript
问题 I have 2 dropdown menus that read their data from a MySQL database. I use php for connecting to database. The second dropdowns should get populated based on the selection on the first dropdown. The process seems as below to me (correct me if I'm wrong): php section connects to MySQL database and populates dropdown1. user selects a value on dropdown1 and onchange event is called. within the onchange function (which is javascript), a query is sent to MySQL database to fetch values of dropdown2