You can use AJAX for that. Whenever you scan a barcode, your scanner will act as if it is a keyboard typing into your input type="text"
components. With JavaScript, capture the corresponding event, and send HTTP REQUEST and process responses accordingly.