BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> User Tutorials
  New Posts New Posts RSS Feed - Tab index, input field tab sequence
  FAQ FAQ  Forum Search   Register Register  Login Login

Tab index, input field tab sequence

 Post Reply Post Reply
Author
Message
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 5992
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Topic: Tab index, input field tab sequence
    Posted: May 15 2023 at 11:50am
How to handle tab index between input fields


$(document).ready(
function(){
// Liste et séquence des éléments à indexer
// Element list in proper sequence
var tabindexes = [
'WEb057511bb6',
'WEc33ccb1ad1',
'WE3478346dab',
'WE2c1c81ba07',
'WE09a8657c5d'
]
var indexLength = tabindexes.length;
// appliquer la séquence
// apply code to elements
for (i=0;i<indexLength; i++){
var targetID = "#"+tabindexes;
$(targetID).attr({"tabindex":i+1});
}
}
);

Set the list of elements as per your input field list and desired sequence.  You need at least two elements and the total is limited by your patience.

Paste this code in a javascript code block located at EndBody.

Let me know if you have any issues.


Edited by Hobby001 - May 15 2023 at 12:28pm
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 5992
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: May 15 2023 at 12:01pm
If you want the cursor to automatically point on the first input field add the following line to the code

$(document).ready(
function(){

// Liste et séquence des éléments à indexer
// Element list in proper sequence
var tabindexes = [
'WEb057511bb6',
'WEc33ccb1ad1',
'WE3478346dab',
'WE2c1c81ba07',
'WE09a8657c5d'
]
var indexLength = tabindexes.length;
// appliquer la séquence
// apply code to elements
for (i=0;i<indexLength; i++){
var targetID = "#"+tabindexes;
$(targetID).attr({"tabindex":i+1});
}
}
document.getElementById('WEb057511bb6').focus();
);

Of course, use your own element ids
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 5992
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: May 15 2023 at 12:11pm
If you want to prevent tab stop to an input field.
$(document).ready(
function(){

// Liste et séquence des éléments à indexer
// Element list in proper sequence
var tabindexes = [
'WEb057511bb6',
'WEc33ccb1ad1',
'WE3478346dab',
'WE2c1c81ba07',
'WE09a8657c5d'
]
var indexLength = tabindexes.length;
// appliquer la séquence
// apply code to elements
for (i=0;i<indexLength; i++){
var targetID = "#"+tabindexes;
$(targetID).attr({"tabindex":i+1});
}
}
document.getElementById('WEb057511bb6').focus();
$('#WEadh59smru').attr({'tabindex':'-1'});
);


Edited by Hobby001 - May 15 2023 at 12:15pm
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.