使用JQuery和PHP在文本框中自动完成 [英] Autocomplete in textbox using JQuery and PHP

查看:103
本文介绍了使用JQuery和PHP在文本框中自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Autocomplete编写了一个代码,但在运行时它不起作用。请帮助我。我的代码如下:



 <   html  >  
< head >
< meta charset = uth-8 / >
< title > Jquery自动完成< / title >
< link rel = 样式表 href = http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css / >
< script src = http://code.jquery.com/jquery-1.9.1.js > < / script < span class =code-keyword>>
< script src = http://code.jquery.com/ui/-1.10.3/jquery-ui.js.js > < / script >
< link < span class =code-attribute> rel = stylesheet href = /resoursec/demoes/style.css / >
< script >
$(function(){
var availableTags = [
ActionScript,
AppleScript'
ASP,
BASIC,
Clojure,
Groovy,
JavaScript,
Lisp'
PHP'
Perl];
$('#tgs')。autocomplete({
source:availableTags;
});
});
< / script >
< / head >
< body > ;
< div class = ui-widget >
< label = < span class =code-keyword> tags > 标签:< < span class =code-leadattribute> / label >
< 输入 id = tags / >
< / div >
< / body >
< / html >

解决方案

< blockquote>(function(){
var availableTags = [
ActionScript,
AppleScript'
ASP,
BASIC,
Clojure,
Groovy,
JavaScript,
Lisp '
PHP'
Perl];


('#tgs')。autocomplete({
source:availableTags;
});
});
< / script >
< / head >
< body > ;
< div class = ui-widget >
< label = < span class =code-keyword> tags > 标签:< < span class =code-leadattribute> / label >
< 输入 id = tags / >
< / div >
< / body >
< / html >


这将对您有所帮助..

http:// tutsforweb .blogspot.com / 2012/05 / auto-complete-text-box-with-php-jquery.html [ ^ ]


I write a code for Autocomplete, but at run time its not working. plz help me. my code is as follow:

<html>
<head>
    <meta charset="uth-8"/>
    <title>Jquery autocomplete</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/-1.10.3/jquery-ui.js.js"></script>
    <link rel="stylesheet" href="/resoursec/demoes/style.css" />
    <script>
        $(function(){
                var availableTags=[
                                    "ActionScript",
                                    "AppleScript"'
                                    "ASP",
                                    "BASIC",
                                    "Clojure",
                                    "Groovy",
                                    "JavaScript",
                                    "Lisp"'
                                    "PHP"'
                                    "Perl"];
                $('#tgs').autocomplete({
                        source:availableTags;
                    });
        } );
    </script>
</head>
<body>
   <div class="ui-widget">
      <label for="tags">Tags: </label>
      <input id="tags" />
   </div>
</body>
</html>

解决方案

(function(){ var availableTags=[ "ActionScript", "AppleScript"' "ASP", "BASIC", "Clojure", "Groovy", "JavaScript", "Lisp"' "PHP"' "Perl"];


('#tgs').autocomplete({ source:availableTags; }); } ); </script> </head> <body> <div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags" /> </div> </body> </html>


This will help you..
http://tutsforweb.blogspot.com/2012/05/auto-complete-text-box-with-php-jquery.html[^]


这篇关于使用JQuery和PHP在文本框中自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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