Can someone help me find a way when i type a text in an Input text (eg: cars ), and the name of cars (bmw, Chevrolet, etc..) is listed in a select box.
do some one have an idea or an example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are familiar with jQuery and Ajax, this can be performed very simply. You watch the input of the text box and fire off an Ajax request once it reaches a stage you are happy with. The return of the Ajax query is them used to populate a drop down box.
Below is an example of this in practice. You’ll need to either have jquery on your server, or reference a copy held within a CDN (such as Google). I’ve had to edit it a bit in order to protect the innocent, but with a couple of more lines it’ll work fine.
The only item you’ll need to figure out yourself, it by what means should Ajax be called and therefore your drop down list be populated. I’ve used it after so many characters, once a text pattern has been recognised, and as well as a hoover off event. The choice is yours.
JAVASCRIPT
HTML CODE
AJAXCODE.PHP CODE