Dynamically select data from MySQL tables
I wrote a webpage in PHP that allows a user to select a customer from a drop down list that queries a MySQL table. It works fine, but the list of customers has groan and it is a pain to scroll through the list.
I would like to make it so when the user starts to type the name of the customers, the selection in the drop down box narrows. So if Mi is typed, names that start with Mi are the only ones dispalyed. Can someone direct me to an artical or how to on how to do this? I searched the web and didn't find anything. May be my terminology is not right. Thanks |
It already exists in IE and firefox. Typing mi as in your example will jump down the list but not narrow the selection. I am not sure about other browsers. Since PHP is server based so I do not think it possible.
|
It must be my script. I can hit the first letter and it will drop down, but will not go any further. It will only recognize the first letter.
My code looks like this: Code:
echo "<tr><td width='25%'>"; |
i think you are going to want to look into javascript for this. you can create the javascript array with php, then with the onchange event of the input, you can alter the showing list of options. could be a pretty neat little feature.
ps, it is grown, not groan ;-) |
Thanks for the info. I'll start looking a java scripts today.
Quote:
|
I retract my statement Firefox does but IE does not. java is what you want.
|
I am going to buy a Java Script book this weekend. Thanks for the replies.
|
All times are GMT -5. The time now is 03:00 AM. |