Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

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

Avatar

Former Community Member

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?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Not that I am aware of. The default behaviour is that when a button has focus, the enter button will fire the click event.

Also I don't think you can exclude a button from the tab order. If you open the tab palette, you can move the button to the bottom of the tab order, but you cannot completely eliiminate it.

Niall

View solution in original post

6 Replies

Avatar

Correct answer by
Level 10

Hi,

Not that I am aware of. The default behaviour is that when a button has focus, the enter button will fire the click event.

Also I don't think you can exclude a button from the tab order. If you open the tab palette, you can move the button to the bottom of the tab order, but you cannot completely eliiminate it.

Niall

Avatar

Former Community Member

I guess I am still new to Adobe and too used to the space bar in other

programs, I didn't even realize the enter button would work.

And I did try to move the button to the bottom of the tab order but no

luck there, it is the last cell of a table and I am not able to move it

so that you can tab out of the table then back to that button.

Oh well.

Thank You for the answer!

Avatar

Level 4

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

Avatar

Former Community Member

That is great! Thank you, I will definitely use that to manipulate the

tabbing order.

Avatar

Level 4

Glad to be of some assistance. Let me know if you have any trouble.

- Scott

Avatar

Level 10

Wouldn't removing the buttons from the tab order affect accessibility with regards to screen readers and that sort of thing?

I'm curious as I've recently been instructed to learn all about forms accessibility lately.