Our inventory web page was written in php by someone else. I am trying to put a jquery call into the webpage which will make a description appear whenever someone scans a barcode. Everything is working when I test on jsbin.com but I am having trouble getting it to run in the wild. The jquery src parts are in the footer before /body. It doesn't seem like they are wrapped by the ?php tags so I didn't put in echos.
</form>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"> </script>
<script src="inventory.js"></script>
</body>
The problem may be in the javascript though.
var barcodes ={
"000-091-M”:”Hardware - Mini Gender Changer Male to Male",
"000-092-M”:”Hardware - Mini Gender Change Female to Female",
"000-DVI-FF”:”Hardware - Dual Link DVI-I Female to Female Coupler Adapter",
};
$("textarea[id=details1]").on("input", function(){ //on value changed
this.value; //text in textarea details
$("textarea[id=description1]").text(barcodes[this.value]); //lookup barcode and return description into description1
});
The html part this affects would be
<td><textarea id="quantity1" name="quantity1" cols="2" rows="1"></textarea></td>
<td><textarea id="details1" name="details1" cols="25" rows="1"></textarea></td>
<td><textarea id="description1" name="description1" cols="35" rows="1"></textarea></td>
<td><textarea id="message1" name="message1" cols="35" rows="1"></textarea></td>
When they scan the barcode into details1 it should auto populate description1 with the description.
What have I done wrong?
<script>tags should go in the<head>section."000-091-M”the second type seems to be phony. Try replacing them with".