Welcome Guest, Not a member yet? Register   Sign In
How to auto retrieve data from mysql database in select box using another select box?
#3

The thing you describe is actually not simple to do properly.

You should have an AJAX call sending the first select box choice back to the server to repopulate the second select box. Some people do the dirty way, of having ALL the data sent to the page, and use js to populate the second select box as a subset of the total data. This is ok for small sets I suppose but is not generally a good idea.

Because of all the differences in the way your site is set up, which js package you may be using, possible routes in CI, etc., it is not really possible to give you any code that would be relevant. The actual db lookups are relatively easy.

Generally, I try to avoid populating one select box with the choice of a previous one, simply because there are often easier ways to design the UI.

Good luck and best wishes,

Paul.
Reply


Messages In This Thread
RE: How to auto retrieve data from mysql database in select box using another select box? - by PaulD - 12-08-2015, 05:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB