I have a g:textfield, and I want to write something and then show me all the options possible that start with the same letter. I understand that is called AutoComplete.
Maybe using jQuery or JavaScript?? Any ideas??
Thanks in advance!
I have a g:textfield, and I want to write something and then show me all the options possible that start with the same letter. I understand that is called AutoComplete.
Maybe using jQuery or JavaScript?? Any ideas??
Thanks in advance!
Share Improve this question asked Oct 8, 2010 at 17:19 randomizertechrandomizertech 2,32915 gold badges50 silver badges85 bronze badges 1- You can see answer here stackoverflow./questions/10433858/… – Karen Commented May 6, 2012 at 11:09
2 Answers
Reset to default 5How about using an existing plugin:
- jQuery plugin: Autoplete
- Demo
If have problem to use it with <g:textfield>
, Here is a thread that may help you to implement.
say you are going to autoplete on a 'thing' field
- you need an autoplete widget, jquery has one, that you use for the thing field
- you need a server endpoint that finds 'things' based on what the user types in. this endpoint will return json.
thats really it. as you mentioned, the widget will use ajax to query the server when the user types in the field, and it will use the response to draw a div that contains possible pletions.