Barcode in child table

i created one child doctype to do the inevntory based on the barcode.
in child table when i enter the barcode respective fields to be populate autometically.
so what event i have to right in js . please suggest me thanks in advance