I’m actually working on a PDF in Acrobat Pro 2017.
I have 2 multilines text fields (tfDeclaration1 and tfDeclaration2) and and when the first one is full, the text flows to the second text field. That works just fine with this script being attached on the first text field on keystroke event :
var t = this.getField("tfDeclaration2");
if (event.fieldFull) {
t.setFocus();
if (t.value != "") {
// set cursor at the beginning of tfDeclaration2
}
}
What I want next is if the 2nd textfield has already some text, I want the cursor to be set to the first character (position 0) instead of at the end. (that’s what setfocus does)
Is there a way to achieve that ?
I’ve tried a few things setSelectionRange(), moveStart(), setStart() but none of these worked.
Thank you and have a great day.