Hi Jan-Willem,
You're on the right path. You need to use some JavaScript to set the focus. I recommend putting an onChange nanoflow listener on the form field that calls a JavaScript action whenever the condition to jump to the next form field is triggered. You can indeed not use ID's, as they are managed by Mendix and are not reliable. However, the Name that you can configure for any widget is transformed into a class like so: .mx-name-<Name>. So you can use that reliably to find the target using
document.getElementsByClassName('mx-name-nameoftextbox')[0]
Alternatively, you can get all form fields on a page doing something like
document.getElementsByClassName('form-group');
Then determining which one in the resulting array has focus, and moving to the next form field by focusing the index + 1. That should lead to a generic JavaScript action that will go to the next form field anywhere.
Note that you need to find a child of the resulting object, since the actual input is a child of the form-group.