This code finds a scu in a database and displays it as you are typing. It works in all browsers(chrome, IE, opera) except for firefox. If anyone can see why i would greatly appreciate the help.
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script src="chData_test.js"></script>
</head>
<body>
<form name="testForm">
<input type="text" name="scu" id="scu"><input type="button" id="theButton">
</form>
<div id="output"></div>
</body>
$(document).ready(function() {
$('#theButton').click(get);
$('#scu').keyup(get);
function get() {
$.post('data.php', {scu:testForm.scu.value}, function(output) {
$('#output').text(output).show();
});
}
});
<?php
mysql_connect("***.000webhost.com", "a9414387_***", "****");
$scu = mysql_real_escape_string($_POST['scu']);
if ($scu==NULL) {
echo "No entry scu found";
}
else {
$description = mysql_query("SELECT description FROM a9414387_***.inventory WHERE id LIKE '$scu%'");
$description_num_rows = mysql_num_rows($description);
if ($description_num_rows==0) {
echo "scu not found in database";
}
else {
$description = mysql_result($description, 0);
echo "You have selected the $description";
}
}
?>