views:

492

answers:

1

hi my dear friends: i have two radcombobox on my page and i am controling their focus by jquery... also i have some code on their OnClientFocus , therefore focus and blur are so important ... my aspx and jquery code are like this : (without RadComboBox -> OnClientFocus )

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="Darman.WebForm4" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; 

<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
    <title></title> 
        <script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> 

    <script type="text/javascript"> 
        $(function() { 
        $('input[id$=RadComboBox1_Input]').focus(); 
        $('input[id$=RadComboBox1_Input]').select(); 
        $('input[id$=RadComboBox1_Input]').bind('keyup', function(e) { 
                var code = (e.keyCode ? e.keyCode : e.which); 
                if (code == 13) { 
                    $('input[id$=RadComboBox1_Input]').blur(); 
                    $('input[id$=RadComboBox2_Input').focus(); 
                    $('input[id$=RadComboBox2_Input]').select(); 
                } 
            }); 
            $('input[id$=RadComboBox2_Input]').bind('keyup', function(e) { 
                var code = (e.keyCode ? e.keyCode : e.which); 
                if (code == 38) { 
                    $('input[id$=RadComboBox2_Input]').blur(); 
                    $('input[id$=RadComboBox1_Input').focus(); 
                    $('input[id$=RadComboBox1_Input]').select(); 
                } 
            }); 
        }); 
            </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
    </telerik:RadScriptManager> 
    <div> 
        <telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Outlook"> 
            <Items> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"  
                    Value="RadComboBoxItem1" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2"  
                    Value="RadComboBoxItem2" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3"  
                    Value="RadComboBoxItem3" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4"  
                    Value="RadComboBoxItem4" /> 
            </Items> 
        </telerik:RadComboBox> 
        <telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="Office2007"> 
            <Items> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1"  
                    Value="RadComboBoxItem1" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2"  
                    Value="RadComboBoxItem2" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3"  
                    Value="RadComboBoxItem3" /> 
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4"  
                    Value="RadComboBoxItem4" /> 
            </Items> 
        </telerik:RadComboBox> 
    </div> 
    </form> 
</body> 
</html> 

it seems that radcombo box can not foreget it's focus and stick with that , therefore when i play with 2 buttons (enter=13 and upper key=38 as you see in the upper code - Jquery) For Changing Their Focus so RadComboBox OnClientFocus does not fire until i click on my page and Click On the RadComboBox Again...

These Lines do not work:

1-$('input[id$=RadComboBox1_Input]').blur();

2-$('input[id$=RadComboBox2_Input]').blur();

how can i take focus off from radcombo box i destroy it's highlight?

thanks a lot

A: 

the best workaround I've came up with is to focus on some other control.

e.g.

$('#someOtherElementId').focus();
roman m