This is a migrated thread and some comments may be shown as answers.

Enter Key act like Tab Key

1 Answer 104 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Angelo Babudro
Top achievements
Rank 1
Angelo Babudro asked on 18 Nov 2008, 08:08 PM

I have several radcombo boxes on my form I am trying to make the enter key act like  the tab key. I added javascript to the body of the form to force this and it worked for everything except the RadComboBoxes...I have tried capturing the OnClientKeyPressingEvent and setting it to the following javascript function...This part works:

 

 

function HandleKeyPress(comboBox, eventArgs)

 

{

 

//identify the enter key:

 

 

if (eventArgs.get_domEvent().keyCode == 13)

 

{

 

    ///What code goes here        

 

}

}

So my question is what code do I implemement to determine which combobox fired the event and get the focus to move to the control...I have tried several different versions of code but nothing seems to work.


Thanks.

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 21 Nov 2008, 01:56 PM
Hello Angelo Babudro,

You need to find the next control which will receive the focus (a combo, a textbox, whatever) and focus it.
Here is a sample code:

function HandleKeyPress(comboBox, eventArgs) 
//identify the enter key: 
if (eventArgs.get_domEvent().keyCode == 13) 
   var nextCombo = $find("<%= MyNextCombo.ClientID %>"); 
   var input = nextCombo.get_inputDomElement(); 
   input.focus(); 
 

I hope this helps.

Best wishes,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Angelo Babudro
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or