Usually tab indexes are hard coded. Problem is that if you have to insert a new element the tab indexes have to be reordered. This is a pain.
One way is to use indexes in steps of 2, 3 or 4 so that insertion is not a problem. The other way I use is as follows:
//top of view
<?php $tabIndex = 0; ?>
For typical Cake element:
<?php echo $form->text(‘Postajob.job_displaycontact’, array(‘class’ => ‘text’, ‘type’=>’checkbox’, ‘id’ => ‘job_displaycontact’, ‘tabindex’ => ++$tabIndex));?>
or in a non Cake environment:
<input …….. ‘tabindex’ = <?php echo ++$tabIndex; ?> />
This works well for sequential elements which is typically the case.