简体   繁体   English

使html文本字段动态化(自动完成的jquery)

[英]Making an html text field dynamic(Autocomplete jquery)

This is my Mysql query: 这是我的Mysql查询:

mysql_select_db($database_final, $final);
$query_Truck = "SELECT * FROM tbl_truck";
$Truck = mysql_query($query_Truck, $final) or die(mysql_error());
$row_Truck = mysql_fetch_assoc($Truck);
$totalRows_Truck = mysql_num_rows($Truck);

how can i get the data inside this to be in the jquery autocomplete with the id of the truck plate number being the one stored in the database and not the truck plate number itself? 我如何获取其中的数据在jquery自动完成中,而车牌号的ID是存储在数据库中的ID,而不是卡车牌号本身?

You could play around with jQuery's autocomplete . 您可以尝试使用jQuery的autocomplete There are great examples on that site, and the API is on this page. 该网站上有很多很好的例子, API在此页面上。

Or, shameless plug, you can check out a random implementation of autocomplete on my own website, at www.classbooklist.org 或者,无耻的插件,您可以在我自己的网站www.classbooklist.org上检查自动完成的随机实现

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

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