We are doing a count of a scanned item where the user only has to scan the barcode and the form takes care of verifying it is the right item, increments the scan count, and clears the entry field used for scanning. When the quantity scanned = required quantity, they save the record and continue to the next item. The scanner has been programmed to add a tab after each scan to trigger the form rules. The main purpose of the code is to focus the cursor back onto the scanning field after each scan.
I'm currently unaware of any native way to set focus back to a specific field without any user input other than Javascript. If there is a native and easier way to do those actions, please let me know. It that would be a really useful form rule though. E.g. If a flag field is true, set focus to field x.