Autocompleter 自动完成提示填写input
本例用的是prototype.js,请注意
其他js代码请到演示页面下载
PHP Code
- <script type="text/javascript">
- var autocompleter = null;
- Event.observe(document, 'dom:loaded', function() {
- autocompleter = new MY.Autocompleter({
- input : 'manufDesc',
- url : 'get_manufacturers_list.php',
- indicator : 'ai',
- required : true,
- initialText : 'Enter a manufacturer'
- });
- });
- </script>
XML/HTML Code
- <label for="manufDesc">Choose a name:</label> <input type="text" id="manufDesc" name="manufDesc"><span id="ai" class="my-autocompleter-indicator" style="display:none"> </span>
原文地址:http://www.freejs.net/article_biaodan_546.html