View Full Version : Repopulating a List Box

06-06-2004, 09:00 AM
Hi Guys,
This is just a theory question at the moment unless any knows how to do it in PHP.

Example: You have a form to fill in and you need to control the input from the user to get the same results entered from everyone.

If you populate a list box from the "county" field in an address db you will end up with a list over 50 entries long!

If is possible to refresh the list based on the input entered by the user. The user inputs 'S' and the list then repopulates to only the entries starting 'S', the user them types 'o' and the list then repopulates with only the entries starting 'So', and so on until only one or two options remain in the list box

The other trick will be to keep any data the user has already input into the form, name etc while they are "drilling down" through the 'county' list box.

I've seen it done in applications but can it be done in PHP.

Looking forward to seeing if there is an answer

06-06-2004, 10:44 AM
i'm not shure i understand exactly what you mean by the 50 entires long but from what i've understood, if you want to change it on the fly you'll be needing Javascript. if you use JS don't forget to check the data when the form gets submitted(never know who might have a quirky browser or bad intention when submitting a form) even if you want to reload the page with new data when somone tpyes in one key thnen you'll need javascript. without JS this scenario might become quite user un-friendly.