简体   繁体   English

有关提前引导的问题

[英]Issues on bootstrap typeahead

Can we bypass on apostrophe on typeahead? 我们可以绕过typeahead上的撇号吗?

I have the following data which I brought from database in array: 我有以下数据是从数据库中以数组形式带来的:

"31-Apple","53-Apple","58-Banana", "98-Lady's Finger" “ 31个苹果”,“ 53个苹果”,“ 58个香蕉”,“ 98个手指”

but the display is 但显示是

在此处输入图片说明

whereas I need is 而我需要的是

在此处输入图片说明

with (') How can I manage to get the solution? 与(')一起如何解决?

<?php $list=NULL;
    $getcom=mysql_query("select * from tblcommodity order by commodityname");
    while($setcom=mysql_fetch_array($getcom))
    {
        if($list==NULL)
        {
            $comma="";
        }
        else
        {
            $comma=",";
        }
        $list.=$comma."\"".$setcom['commodityid']."-".$setcom['commodityname']."\"";
    }
?>
<input type="text" class="span3" autocomplete="off" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source='[<?php echo $list ?>]' name="CommodityID">
$('#id').typeahead({
   name: 'Author',
   local: ['12-BalaGuruSwamy', '11-Forouzan', '10-Wayne Tomasi', '9-William Stallings', '8-John C Martin', '7-Robert Lusier']
});

You should pass the database response into the local like the above, you can achieve the functionality you need.. 您应该像上面那样将数据库响应传递到本地,您可以实现所需的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM