Is there a way to have the tab strip goto the next tab when a user hits the tab key on the last control on the current tab? From a heads down data entry perspective, it would be nice to be able to just tab from one tab to the next.
Thanks!
1 Answer, 1 is accepted
0
Veselin Vasilev
Telerik team
answered on 06 Oct 2008, 11:00 AM
Hello Charlie Bross,
You can do something like this:
1. Subscribe to the onkeydown event of the document.
2. Check if the entered key from the user is Tab.
3. Select the next tab.
Here is a sample javascript code:
<script type="text/javascript">
document.onkeydown = onKeyDownHandler;
function onKeyDownHandler(e)
{
if (!e)
{
e = window.event;
}
var key = e.keyCode;
//Tab is pressed
if (key == 9)
{
var tabstrip = $find("<%= RadTabStrip1.ClientID %>");
var tab = tabstrip.get_selectedTab();
if (tab)
{
var index = tab.get_index();
var nextTab;
//get the next tab
nextTab = tabstrip.get_tabs().getTab(index + 1);
if (nextTab)
{
nextTab.select();
}
else
{
//select the first tab
nextTab = tabstrip.get_tabs().getTab(0);
nextTab.select();
}
}
}
}
</script>
I hope this will get you started.
Best wishes,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.