How to add tabindex for each radio button option?

zend-mvc
zend-view

#1

Hi All,

I added a radio button from form and when I give the tabbing to that it giving same to all 3 radio button, May be because I am giving for the whole,
So I just wanted to know that is there a way to give separate tagindex to all 3 of radio button option.
Here is my code

$this->addElement('radio', 'gender', array(
'label'=>'Gender',
'class' => 'signup-name',
'multiOptions'=>array(
                '2' => 'Male',
                '3' => 'Female',
                '111' => 'Other',
                ),
'tabindex' => $tabIndex++,

));
Thanks


#2

With HTML it is not possible to set a tab index per radio button as it is one element, a radio group. The tab index moves from one element to another. A user can navigate to the radio group using tab or shift+tab for previous. When the group is focussed, using tab, the first element is focussed and one can focus any other radio button by using the up/down arrow keys and space to select the value.

See https://www.w3.org/TR/2009/WD-wai-aria-practices-20090224/#kbd_general_ex

Hope this helps!