In this post I will show you a simple way to create a dynamic dropdown in CodeIgniter with some Ajax ofcourse. So, you have a dropdown menu and depending upon the choice made by the user in that one, another dropdown gets triggered with appropriate choice.
So, what will we do is:
- Create a dropdown menu with a list of table names.
- As the user selects any one of the table names - we will auto-populate the second dropdown with a year dropdown corresponding to the table from our database.
You probably didn't understand the above points? No worries, you'll know something at the very end of this post and what it is all about.