May I know if it is possible to query InfoPath 2007 web-based form via a bar code scanner.

I have a bar code scanner and a web-based InfoPath form. The InfoPath form contain one section for query data based on a text field (let's name this text field as 'Query'). So, when the bar code scanner scan the bar code of a piece of paper, it will be enter into the 'Query' text field and the result will appear.

2 Answers 2


If the barcode scanner works just by faking keyboard entry of the numbers and then simulating a press of the enter button, then you can simply make sure that the input field has focus when the page loads.


Put that bit of javascript at the end of the page content and it should work as you expect.

If it doesn't simulate a press of the enter button, then you should set an event on the textbox's onchange event or something similar (maybe set a timer) and check whether input has been entered into the query field. Once there is data in the field, submit the form.

  • May i know what you meant by at the end of the page content?
    – Wilson Tan
    Sep 23, 2011 at 8:23
  • I mean that you'd write that javascript somewhere near the bottom of the page. Preferably just before the </body> html tag. Really though, it would be fine anywhere after the query textbox. If you write it before, it will error because at the point when it's running the textbox doesn't exist :)
    – soniiic
    Sep 23, 2011 at 9:56

Actually, I found another work around.

I select the text field box and use the bar code scanner to scan the bar code and input the value into the text field box.

Then, I click a button label 'Query' and it will display all the data related to that bar code value.

  • pls Wilson can you explain better teh way you did this? What happens when you click the button? How you activate the barcode scanner?
    – user6079
    Dec 18, 2011 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.