CodeIgniter Forums
DB driven dynamic changing boxes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: DB driven dynamic changing boxes (/showthread.php?tid=35829)



DB driven dynamic changing boxes - El Forum - 11-12-2010

[eluser]CI_Newb[/eluser]
Basically my app uses 3 dropdown boxes that change based on what is selected from box to box.

Right now, its done by javascript and static files that contain the arrays. Problem I'm running into is that I'm getting requests for changes, additions, etc consistently as my user base grows.

So what I'm looking for is a database driven one preferably using ajax. Like a country/state/city type system.

Does anyone know of a good one out there thats easy to install and configure?


DB driven dynamic changing boxes - El Forum - 11-12-2010

[eluser]Crimp[/eluser]
You can roll your own. Make a xhr call to a controller that returns the data based upon the change event of the "previous" box. Append the data to the "next" box. If you use jQuery, it's only a few lines of code.


DB driven dynamic changing boxes - El Forum - 11-13-2010

[eluser]CI_Newb[/eluser]
[quote author="Crimp" date="1289626766"]You can roll your own. Make a xhr call to a controller that returns the data based upon the change event of the "previous" box. Append the data to the "next" box. If you use jQuery, it's only a few lines of code.[/quote]

Thats good to know! but i'm not that good yet to write my own.

Any good tutorials out there that you can recommend?


DB driven dynamic changing boxes - El Forum - 11-15-2010

[eluser]Crimp[/eluser]
http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/


DB driven dynamic changing boxes - El Forum - 11-15-2010

[eluser]smilie[/eluser]
That's a bit old document (tho' working).
I could send you over two days (once at work again) a working sample I created few days ago.
It also involves jQuery...

Let me know if you need it.

Cheers,
Smilie