0

Control the focus of a field

I have a text field that takes data from a scanner and runs a script when modified. I would like the focus to go back to that field automatically, ready for another scan. Is it possible?

3 replies

null
    • John_Halls
    • 5 days ago
    • Reported - view

    I came up with a workaround for this. After much experimentation, I noticed that the focus is lost with an ENTER but will move to the next field with a TAB as long as there is a next field to go to. My goal was to be able to scan products into an ePOS system without needing to use the keyboard between each scan (mimicking what we would see at a supermarket checkout). I ended up changing the scanner to add a TAB after each scan, and to have a pair of scan fields so that each scan toggles the focus to the other field. Really pleased with the end result.

    My take from this? There is always a way...

    Regards John

      • szormpas
      • 2 days ago
      • Reported - view

       Hi,

      I'd like to move the focus to a "Search" text field after pressing the "Clear" button. I was wondering if your method would work for my situation. How can I simulate a tab press programmatically?

      Best wishes

      Sotirios

      • John_Halls
      • 23 hrs ago
      • Reported - view

       I couldn't find a way of moving the focus to a field and my ePOS still needs a mouse click after the end of a transaction to put the cursor back into a scan field.

Content aside

  • Status Answered
  • 23 hrs agoLast active
  • 3Replies
  • 49Views
  • 2 Following