this barcode scanner will show
KD-R411ED 105X0001 inside one
textfield...i want it become KD-R411ED
in first text field and 105X0001 in
other textfield...all automatically
separate into two textfield after scan
the barcode... but for actually it
appear in one textfield...this program
is under progress...
you can do this...
var barCode = 'KD-R411ED 105X0001';
var data = barCode.split(" ");
you can access data this way...
var product = data[0]; // output KD-R411ED
var serial = data[1]; // output 105X0001
edit
your code:
<script type="text/javascript">
function addtext() {
var barCode = this.(text);
$("#model").change(function() {
barCode = $this.val();
var data = barCode.split("");
$("#model").val(data[0]);
$("#serial").val(data[1]);
});
};
</script>
try this:
<script type="text/javascript">
$(document).ready(function(){
$("#model").change(function() {
var data = $(this).val().split(" "); // not the space in .split(" ")
$("#model").val(data[0]);
$("#serial").val(data[1]);
});
});
</script>