【发布时间】:2014-03-02 12:14:54
【问题描述】:
我正在使用这些代码,但我需要加载在文本框中键入的数据,而无需按 Enter 或提交按钮。
这是我的aaa.php 文件。我将此系统用于条形码扫描仪:)
输入条形码
</table>
</form>
<hr />
<?php
require_once('dbconnect.php');
$txtbarcode=$_POST['barcode'];
$result=mysql_query("SELECT * from barcode where itemcode='".$txtbarcode."'");
echo "<center><table border=1>";
echo"<tr><th>ITEM CODE:</th><th>ITEM:</th><th>QTY</th><th>SRP</th><th>MARKUP RATE</th><th>SELLING PRICE</th></tr>";
while($row=mysql_fetch_array($result))
{
echo"<tr>";
echo "<td align= center>".$row['itemcode']."</td>";
echo "<td align=center>".$row['item']."</td>";
echo "<td align=center>".$row['qty']."</td>";
echo "<td align=center>".$row['srp']."</td>";
echo "<td align=center>".$row['markup']."</td>";
echo "<td align=center>".$row['sp']."</td>";
echo"</tr>";
}
echo "</table>";
mysql_close($con);
?>
</body>
</html>
【问题讨论】:
-
使用 Ajax 和 jquery。条形码文本框的模糊事件触发 ajax 请求
-
您想提交值,但不想接受任何用户输入进行提交?对吗?
-
不,我想在用户输入后插入数据。不使用提交按钮。条码扫描场景:D
标签: javascript php jquery html barcode-scanner