Integration with barcode scanner Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Integration with barcode scanner This topic has 5 replies, 2 voices, and was last updated 1 year, 8 months ago by Ernest Marcinko. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts September 23, 2024 at 5:31 pm #50188 samuelepellizzariParticipant Hi there, I’m trying to integrate your plugin with a barcode scanner using the phone camera. The scanner works well in that it scans and places the right value in the Ajax Search Pro form, with the following Javascript code upon scanning: $(“input.orig”).val(sBarcode); However, the search isn’t triggered, unless I click on the form and press enter. Could you please advise? Many thanks, Samuele Pellizzari September 24, 2024 at 7:13 am #50195 Ernest MarcinkoKeymaster Hi, Sure! You can use the search javascript API to trigger the search, even to input the value you need: ASP.api(1, "searchFor", sBarcode); September 24, 2024 at 7:18 am #50196 samuelepellizzariParticipant Hi Ernest, Many thanks for your reply! Would that trigger the ajax live search, too? That would be nice, in order not to leave the page. Or triggering live results would require a different code? Thanks again, Samuele September 24, 2024 at 8:41 am #50199 Ernest MarcinkoKeymaster You are welcome! Yes – this triggers the live search as well. September 24, 2024 at 11:11 am #50203 samuelepellizzariParticipant Hi Ernest, Sorry, but I can’t get it to work. Probably am I missing something? Here is the complete code: var barDataEl = document.getElementById('status'); for (var i = 0; i < barcodeResult.length; ++i) { var sBarcode = DSScanner.bin2String(barcodeResult.at(i)); barDataEl.innerHTML = barcodeResult.at(i).type + ': ' + sBarcode; $("input.orig").val(sBarcode).focus(); ASP.api(1, "searchFor", sBarcode); } September 24, 2024 at 11:17 am #50204 Ernest MarcinkoKeymaster The search ID might be incorrect, maybe dynamically fetching it could work: ASP.api(parseInt($('input.orig').closest('.asp_w').data('id')), "searchFor", sBarcode); Author Posts Viewing 6 posts - 1 through 6 (of 6 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In