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

I have a g:textfield, and I want to write something and then show me all the options possible that star

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745665284a4639086.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信