This post is dedicated to my new friend (more than a brother) that gives me the challenge, praveen kumar
Special thanks to Iron Maiden, gave me reassurance and empathy with the task. lol
- First Step
Create a regular form (in my case) and the Fields
I put it on the form three char fields
The properties of the fields that matter to us are: length and ID.
- Field 1
- ID: 700000000
- Length: 3
- Field 2
- ID: 700000001
- Length: 3
- Field 3
- ID: 700000002
- Length: 4
So, as I said at the top, the script should change focus when it reaches the maxlength of each field.
So, how does the js works?
In your form, open Property > Appearance (double-click the form or keep the tabs open)
Open the Web Header Content property and write your code (below you can see my code)
Here is the magic
Now, lets create our active links that calls the js on execution time.
So, we have 3 fields and I need to change focus from the first to the second and the second to the third, I will create two active links for these tasks.
The first active link
Permission : Public
Execution Options: Submit | Field - Gain Focus (barcat_field1)
If Action (here I will call the js function)
I am using a Run Process to call it. The code is below.
Remember my fields ID’s? Look it here (document.getElementById('arid_WIN_0_700000000'))
I am passing 3 parameters to the function onkeyup
The value of the field
The length of the field
The next field
The second active link is almost the same, just change the ID of elements.