In our previous tutorialswe have explained you , how to create and validate formsin codeigniter. Then create an HTML form with a select option & text input field and display data from the database in the select option. CodeIgniter: Trying to load the option values from database table based on the selection of first select option There were a couple of issues regarding the code. I suspect thats because you put selected on every option, so the browser just picks the most-recently-selected, which is the last one. Read Also: CodeIgniter Login and Registration System with Source Code Don't Miss: Code Igniter Pagination with Search Filter using Bootstrap That explains about creating dynamic dependent select box using codeigniter and ajax. Before the while loop I store the details in variables as such: and this works. ; Use the multiple attribute to create a list that allows multiple selections. was the last line of my answer your problem? $password It must contain password of the database. How do I make a placeholder for a 'select' box? It depends on what criteria you want to use to determine which select option, if any, you want to be as the selected. To create select options dependent in Codeigniter and AJAX Jquery, here's what you need to prepare: Even though Bootstrap and Datatable are optional, I strongly recommend that you have all the lists above. For retrieve data from MySQL database using CodeIgniter framework first we have to create a table in data base. Only one change in this tutorial in ctrl_view.php on line 28 it must be, The dynamic dependent select box auto-populates dependent data in the dropdown based on the selection. Do peer-reviewers ignore details in complicated mathematical computations and theorems? 528), Microsoft Azure joins Collectives on Stack Overflow. I hope this makes sence? Then rename the CodeIgniter project to be select-ajax. How can I store the value of a user selected option from a drop down select box list into mysql database? An example of data being processed may be a unique identifier stored in a cookie. I have fixed it now and it was because of how I was closing one small '>' inside the echo !!! CodeIgniter (CI) is a PHP framework that helps building a full-fledged web application. Is this variant of Exact Path Length Problem easy or NP Complete, Indefinite article before noun starting with "the". How do I style a