How do I change which box you "tab" to?

Get help using Construct 2

Post » Mon May 15, 2017 3:31 pm

I have a page of text boxes but unfortunately when i created them i didn't place them in the order they were created so now when you press Tab to go to the next box down it skips around the page to all the different boxes.

Is there a way to overwrite this and make it so for example, when a certain box is being used (on clicked, set a value to identify which box is being used) pressing tab will take you to a specified box?

Thanks
B
5
S
1
Posts: 65
Reputation: 507

Post » Mon May 15, 2017 5:03 pm

That would be the "tabIndex" property of form elements, however, the plugins don't expose it unfortunately.

You can easily expose it through a behavior though. Add this behavior I cooked in a hurry to your form elements and set the property "TabIndex" to a value from 1 to n and you should be good.

https://www.dropbox.com/s/d0hxdh5r426zi ... x.zip?dl=0
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Tue May 16, 2017 9:27 am

Thanks a lot, nice behavior.
B
5
S
1
Posts: 65
Reputation: 507

Post » Tue May 16, 2017 12:13 pm

Seriously, Saved me a lot of time with this behavior. Thanks a lot.
B
5
S
1
Posts: 65
Reputation: 507

Post » Tue May 16, 2017 3:34 pm

Yeah, too bad it's not a vanilla functionality. It's such a small thing that unfortunely I guess it was completely forgotten. Glad I could help you! ;)
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Wed May 17, 2017 12:20 am

@ErudioLtd @Magistross

for future reference - you can set the z-order of the form elements to change the tab order.
B
94
S
33
G
20
Posts: 438
Reputation: 17,615

Post » Wed May 17, 2017 10:38 am

AllanR wrote:@ErudioLtd @Magistross

for future reference - you can set the z-order of the form elements to change the tab order.


Thanks for the tip, thought it was being decided by the UID or soemthing.
B
5
S
1
Posts: 65
Reputation: 507

Post » Wed May 17, 2017 2:36 pm

Without tabIndex the elements tab in their order of appearance in the DOM. Turns out they are created in the reverse order as their "z-index" (the one in the front, or the last in the list, will be the first element to be tabbed to). It's still much easier to use a behavior to directly set a tabIndex and not rely on automatic ordering.
B
67
S
28
G
24
Posts: 970
Reputation: 18,675


Return to How do I....?

Who is online

Users browsing this forum: alextro, Ryan Kocourek and 4 guests

cron