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

When I select an item with the mouse in an ajax panel - tab index jumps to the masterpage

6 Answers 26 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 03 Nov 2008, 04:39 PM
Hi..
I have a combo box in a large ajax form. When I click on item using the mouse the cursor jumps to my main menu on the page. When I select the item with the enter button it works fine and tabs to the next control.
Any ideas?
thanks

6 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 04 Nov 2008, 01:24 PM
Hello Jon Elster,

Please find the attached project illustrating how to achieve the desired functionality.

Hope this helps.

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 04 Nov 2008, 01:51 PM
Hi..
I doesn't appear to set the focus and place the cursor in TextBox1?

It runs fine... what I am I missing?
thanks
0
Rosi
Telerik team
answered on 04 Nov 2008, 02:04 PM
Hi Jon Elster,

The javascript code focusing the textbox control is registered in the SelectedIndexChanged event of RadComboBox:
protected void radComboBoxLocation_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
        string script = @"function FocusTxt()
        {
            var txt = $get('TextBox1');
            setTimeout(function() {txt.focus(); }, 100);
        }
        FocusTxt()";  
        ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "focusTextBox", script, true);  
 
    } 

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 04 Nov 2008, 02:08 PM
When I run your sample - the texbox1 does not get focus

???
What am I missing?
thanks
0
Rosi
Telerik team
answered on 04 Nov 2008, 02:27 PM
Hi Jon Elster,

I am sorry for the misunderstanding.

Could you please share what is the browser that you use? This project is tested with IE7 and FF2 and FF3.

If you use IE 6 you can change the timeout to 500 instead of 100 and try it again:
   protected void radComboBoxLocation_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
        string script = @"function FocusTxt()
        {
            var txt = $get('TextBox1');
            setTimeout(function() {txt.focus(); }, 500);
        }
        FocusTxt()";  
        ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "focusTextBox", script, true);  
 
    } 

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 04 Nov 2008, 02:32 PM
Thanks that worked!
Tags
ComboBox
Asked by
Jon
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Jon
Top achievements
Rank 1
Share this question
or