- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Datalist 属性在 Google chrome 中不工作,在 Firefox 中工作正常
提前感谢您的帮助。
HTML
<td><input onkeyup="showCustomers(this.value)" placeholder="Enter Customer Name" list="selectCust" name="Cno" />
<datalist id="selectCust">
</datalist>
</td>
Javascript
function showCustomers(str) {
if (str.length == 0) {
document.getElementById("selectCust").innerHTML = "";
return;
} else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("selectCust").innerHTML = xmlhttp.responseText;
}
};
xmlhttp.open("GET", "getCustomers.php?q=" + str, true);
xmlhttp.send();
}
}
getCustomers.php文件
<?php include('conn.php'); ?>
<?php // get the q parameter from URL
$q = $_REQUEST["q"];
// lookup all hints from array if $q is different from ""
if ($q !== "") {
$q = strtolower($q);
$len=strlen($q);
$sql2 = 'SELECT Customer_Name as Cname,No from customers order by Customer_Name';
$result2 = mysqli_query($connection, $sql2) or die(mysqli_error($connection));
if (mysqli_num_rows($result2) > 0) {
?><option value=""></option><?php
// output data of each row
while($row2 = mysqli_fetch_assoc($result2)) {
if (stristr($q, substr($row2["Cname"], 0, $len))) { ?>
<option value="<?php
echo $row2['No']; ?>"><?php echo $row2["Cname"]; ?></option>
<?php } } ?>
<?php } } ?>
我根本没有用过 CSS。
最佳答案
改为在您的 CSS 中定位 ID,这应该可以正常工作。
HTML:
<datalist id="dl">
Your content goes here
</datalist>
CSS:
#dl {
display: block;
}
这在 Chrome 或任何其他浏览器中都可以正常工作。
关于html - Datalist 属性在谷歌浏览器中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36593924/
我正在尝试为模板中循环内的循环创建一个带有子 DataList 的 DataList: public function getAllCategoriesAndEntrys(){ $catego
griview优点:功能最强大,提供分页,编辑,删除,选择等等很多功能,使用最方便,直接拖拽到页面上,建立新的数据源,点几下鼠标就可以维护一个表的浏览、删除和修改了,而且是分页的哦。(增加我还没搞明
我将 10 个选项传递给数据列表,这些选项在下拉列表中显示良好。但有时我会在选项列表底部获得更多由水平线分隔的选项(Chrome 可能正在缓存或重复显示某些选项)。我不明白为什么 chrome 显示这
是否可以将图像添加到数据列表选项中?我正在为我的用户构建一个搜索,我希望头像与姓名和简介一起显示在数据列表中,就像在 Twitter 或 Facebook 上一样。 $avatar变量具有指向图像的链
我在 VueJS 中使用 datalist 搜索时遇到 input 问题,为什么当我用鼠标单击或在 datalist 上的选项之一上输入时,我的函数 getData() 被调用到 @click 和 @
我正在使用 .NET aspx 进行编程。在 asp:DataList 组件中,我想均匀分布列,即使并非所有列都分配有 ItemTemplate。 例如 ... 在运行时,绑定(bind)到数
给定一个表格: console.log(document.getElementById('f').elements['a']); console.log(document.getElementById
Datalist 属性在 Google chrome 中不工作,在 Firefox 中工作正常 请看这里http://prntscr.com/arny81 提前感谢您的帮助。 HTML
我有一个如下的模板: {{i-1}} 还有一个像这样的 TS 文件: import {Component, OnInit} from '@angular/co
使用这个例子http://www.w3schools.com/tags/tag_datalist.asp- 我在浏览器中没有问题,但它似乎在打包的应用程序中不起作用。 我使用的是 Chrome v26
代码如下: PEAEWebSiteDataContext context = new PEAEWebSiteDataContext(); &nbs
如何禁用 Datalist 中的选项? London Zurich Italian Turin Milan Rome Naples French Bordeaux Lion Paris 我尝试
所有实现 IEnumerable 接口(interface)的类型都可以用于 DataList 的 DataSource。例如列表。但是我们将为 ItemTemplate 中的数据绑定(bind)表达
我正在使用以下 Javascript 函数来填充数据列表: function GetDropDownData(f) { $.ajax({ url: '/Rentals/Base
在我的数据列表选项中,有英语和韩语的值。 这是示例: (<-This value is apple in Korean) 当我尝试在输入框中使用韩文字母搜索值时,没有显示任何内容,仅以英文值工
我已经在数据列表文件夹上应用了规则,就像在每个项目创建上一样,它应该向相应的人发送一封电子邮件。 下面是相同的脚本: function main() { var site = siteServ
我有一个页面,用户可以在数据列表控件中选择不同的文档文件。使用预渲染事件处理程序根据类别对文档进行分类。文档是根据复选框控件(而不是复选框列表)选择的。到目前为止,一切都很好。接下来我想要发生的事情是
我的页面上有 DataList,用于显示来自数据库的记录。我已关注this使用 DataList 实现分页的教程。 它在第一页上显示 5 条记录,但在下一页上,数据列表加载为空。我可以通过单击“下一步
我在DataList中有一个UserControl,我根据DataList数据的PrimeryKey填充用户控件内的控件。第一次加载程序的行为符合预期,但当用户更改页面索引时,所有 MessageID
我有一个数据列表,在它的标题模板中有一个链接按钮。在我的代码隐藏文件中,我像往常一样写: ((LinkButton)(DataList1.FindControl("LinkButton1"))).En
我是一名优秀的程序员,十分优秀!