im using these codes but i need to load the data typed in the textbox without pressing enter or a submit button. this is my aaa.php
file. im using this system for a barcode scanner :) ENTER BARCODE
</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>
Use "onchange" event on your input element for example.
<input type="text" id="barcode" name="barcode" onchange="postData(this)" />
then you can do what ever you want via AJAX.
function postData(my_object){
$barcode = my_object.value;
// ...
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.