Why doesn't the space bar "click" the button when tabbing through the form?

Avatar

Avatar
Validate 10
Level 1
Patti_Y_
Level 1

Like

1 like

Total Posts

24 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
Patti_Y_
Level 1

Like

1 like

Total Posts

24 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
Patti_Y_
Level 1

28-11-2011

I want to know if it is possible to edit the buttons on my form so that when a user is tabbing through the form while typing they can just hit the space bar while the button is highlighted to "click" it.  Also, if anyone knows can a button be removed from the tab order?

View Entire Topic

Avatar

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile
past-tense
Level 2

29-11-2011

Hi there,

There is one way to remove buttons completly from the tab order. It takes a bit of work to acheive, but I do this for all of my forms... In the exit event of all fields that I wish to tab through, I include the following code:

if (xfa.event.commitKey == 3) then

     xfa.host.setFocus("NextFieldsSOM")

endif

What the above says is 'If the person is leaving this field by pressing tab, then set the focus to the field at NextFieldsSOM (Where NextFieldsSOM is the relative or absolute reference to the next field).

This completely overrides the tab-order that the form would otherwise decide to use. The reason why I do this is that I've noticed that some forms, especially dynamic forms with repeatable subforms, refuse to tab as I specify using the built-in tab-order mechanism. Doing this allows me to programmatically decide which field should be tabbed through first.

You can use a combonation of the two methods (manual & programmatic), just using the code to specify the tab order for things where you wish to override the natural order of things. I personally set the tab order progammatically for the entirety of all my forms. The level of control that this allows me far outweighs (in my oppinion) the amount of effort this takes.

For example, in the last field of a repeatable subform, I need to check to see if there is another 'copy' of the subform below. If there is, I should tab to the first field in the next instance of the repeated subform, if not, I need to tab to the next area. To do this, I use some code similar to:

if (xfa.event.commitKey == 3) then

     if ($.parent.instanceIndex < $.parent.instanceManager.Count - 1) then

          xfa.host.setFocus(concat("$.parent.parent.sf_repeatable[", $.parent.instanceIndex + 1, "].FirstFieldName"))

     else

          xfa.host.setFocus("$.parent.parent.sf_nextSection.FirstFieldOfNextSectionName")

     endif

endif