如何使用Java脚本设置Ajax自动完成文本框集 [英] how to set ajax auto-complete text box set of with java script

查看:72
本文介绍了如何使用Java脚本设置Ajax自动完成文本框集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

如何设置用Java脚本设置的Ajax自动完成文本框

Dear all,

how to set ajax auto-complete text box set off with java script

推荐答案

您将需要使用XmlHttpRequest即XHR对象来实现AJAX.
步骤.
1.在文本框旁边放置一个div
2.实现onchange的观察者,并调用XHR例程(使用原始对象来实现自己的过程,或者使用行业标准的JQuery或YUI Java脚本库)
3.调用成功后,将ajax的结果放在用于下拉列表的附加div的innerHtml中-从步骤1)开始
4.同样在div上,放置一个用于单击的观察器以供选择,然后填充文本框并隐藏div

然后...这应该做:)
You would need to implement AJAX using the XmlHttpRequest ie XHR object.
Steps.
1. Place a div next to the text box
2. Implement observer for onchange, and call the XHR routine ( implement your-own using raw object or utilize the industry standard JQuery or the YUI java script library)
3. On success of the call, place the result of ajax in innerHtml of the attached div used for dropdown - from Step 1)
4. On the div as well, place a observer for the on-click for selection and later populating the textbox and hiding the div

And ... This should be done :)


从这里开始:
插件/自动完成 [ jQuery自动完成 [ ^ ]

此处:演示和详细信息 [
Start from here:
Plugins/Autocomplete[^]
jQuery AutoComplete[^]

Here: Demo and details[^]


这篇关于如何使用Java脚本设置Ajax自动完成文本框集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆