I can’t find quite the answer I’m looking for anywhere. I have a plugin that generates barcodes. All you do is tell it what element to render the barcode, and it spits it out. For example:
$("#barcode-target").barcode("Output Goes Here", "code39",{barWidth:2, barHeight:30});
will put a barcode that says “Output Goes Here” into the div #barcode-target.
However, I need it to generate a barcode with the value of a certain text input. I tried doing something along the lines of
$(function(){
$("#barcode").keyup(function () {
var value = $(this).val();
$("#barcode-target").text(value);
}).keyup();
});
Which, of course, only puts plain characters in the div. I’m stuck!
Edit
I’ve also tried
$(function(){
var barcodeVal = $("#barcode").val();
$("#barcode-target").barcode("barcodeVal", "code39",{barWidth:2, barHeight:30});
});
Still nothing…
You need to create a barcode the way you said: