function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to set Tab Order for a apex:inputField component

I am apex:inputField visual force component on a Visual force page by using the StandardController and want to set the Tab Order (that should be vertically) for all the fields. I am not finding any attributes for the apex:inputField to set the Tab Order.

I tried to use the "tabindex" but did not work. The "tabindex" works for the apex:inputText but not for the apex:inputField.

Any idea?

Thanks in advance..........

Try using nested pageBlockSections with only a single column (columns="1"), and without a title attribute. Tabbing within each single-column, nested pageBlockSection will be vertical. Include a title attribute on the enclosing pageBlockSection and you should be in business...
Problem with that it that the columns are squeezed - looks odd - soulution would be to allow to set the tabindex on inputField
I am new to VF pages, but it sounds like JJ12345JJ is right, and this is an a basic omission.  If it is an available option in standard HTML and in inputText, then it should be an option in inputField. 

I did some poking around and apparently there is a 'tabIndex' property on other input types, but not inputField.  I did, however, find a hack that can work if you are desperate:




There is another solution 


we can set the tabindexes to other elemets. For inputField tabindex can be set using javascript as follows by calling onfocus of previous element of inputfield



function setTabindexfordueDate(){
    var dueDateEle = document.getElementById('{!$Component.taskForm.........................}');
    //alert('dueDateEle : ' + dueDateEle);
    var tabindexOfEle = dueDateEle.getAttribute("tabindex");
    //alert('tabindexOfEle : ' + tabindexOfEle);


function setTabindexfordueDate() {

      var dueDateEle = document.getElementById('{!$Component.taskForm.pbarId.taskdetail.Task__c_id_duedatetime__c}');