Jump to content

how to use arrow keys with AJAX ?


jasonc

Recommended Posts

hello all,

 

I have a little problem that i hope can be solved.

 

senerio....

 

You start to type in an <input> field and a list of results show based on what you type, I have a list of Airports in MySQL that is check for LIKE of what is typed in and the matches show that can be selected. But you can only scroll with the mouse and not the arrow keys.

 

Does anyone know how I may allow arrow keys as well as the mouse to select their choice?

Link to comment
Share on other sites

So you're using an autocompleter?  Are you using a prebuilt autocompleter or did you write your own?  We'd need to see that in order to help.  Something in your code is breaking it. 

 

If you haven't noticed from my other posts, I'm a HUGE fan of jquery and the jqueryUI.  They have an autocompleter that I got up and running pretty quickly--it's stylable, can use local arrays or AJAX as a source, and works just like what it sounds like you're intending. 

Link to comment
Share on other sites

this is what happens

 

the user logs in and starts to type in the 'name' field and based on what details they have previously stored in their customer area a list of names show that contain the phrase as they type.

 

the list is grabbed using AJAX and the results are shown using <div>'s  with an onclick in the div so it places that name selected in the field.  this also places other details of the named person in the 'name' field, in the other relivent fields on the form.

 

but at present they user can only use the mouse to select the 'name' in the <div>'s that are shown.

 

i wish to have it like google has it like previous phrases other internet uses have typed in.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.