最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Grails: How to make a g:textfield autocomplete? - Stack Overflow

matteradmin5PV0评论

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
Add a ment  | 

2 Answers 2

Reset to default 5

How 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

  1. you need an autoplete widget, jquery has one, that you use for the thing field
  2. 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.

Post a comment

comment list (0)

  1. No comments so far