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

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

问题描述

您好我编写了一个代码来在输入控件中启用jquery的自动完成功能......但是它不起作用。请帮助我。以下是我的代码:

 <   html  >  
< head >
< meta charset = < span class =code-keyword> uth-8 / >
< title > Jquery自动填充< / title >
< link rel = stylesheet href = < span class =code-keyword> 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 = < 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 >


hi i write a code to enable autocomplete feature of jquery in input control ...but its not working .please help me. following is my code:

<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>


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

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