ClientKeyPressing event in firefox

3 posts, 0 answers
  1. Immanuel
    Immanuel avatar
    3 posts
    Member since:
    Sep 2008

    Posted 15 Dec 2008 Link to this post

    Hello,

            I want to post the page when the user hits ENTER key. For that, written a client-side function to handle the keypress. What happened is, this function works well in Internet Explorer but when execute the same in firefox, the keypress event is not properly triggered in all times.

        I attached sample code snippet.
          
    function ClientKeyPressing(sender, eventArgs)  
    {  
        var charCode = eventArgs._domEvent.keyCode;  
        if(charCode == 13)  
        {  
            __doPostBack('<%=lbnSubmit.UniqueID%>','');  
        }  
      

    Any help is appreciated.

    Thanks in advance.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Dec 2008 Link to this post

    Hi Immanuel,

    Check out the forum link which discusses a similar scenario.
    OnClientKeyPressing not working on Firefox 2 or 3

    Regards
    Shinu

  3. Immanuel
    Immanuel avatar
    3 posts
    Member since:
    Sep 2008

    Posted 16 Dec 2008 Link to this post

    Hello Shinu,

            Thanks for your reply. That Really helped me a lot.

    I studied the article link which you adviced me to use. In that article, they used treeview without nested inside any other control.
     
    But in my case RadTreeView is nested inside RadComboBox.

    I attached code snippet for your references.

    <telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="WebBlue" DropDownWidth="300px" Width="150px" Font-Size="11px">  
     <ItemTemplate> 
     <telerik:RadTreeView runat="server" ID="RadTreeView1" EnableDragAndDrop="false" 
           CheckBoxes="true" Width="400px" EnableDragAndDropBetweenNodes="false" TriStateCheckBoxes="true" OnClientKeyPressing="ClientKeyPressing" CheckChildNodes="true">  
    </telerik:RadTreeView> 
    </div> 
    </ItemTemplate> 
    <Items> 
    <telerik:RadComboBoxItem Text="All" Value="All"></telerik:RadComboBoxItem> 
    </Items> 
                                                                            </telerik:RadComboBox> 

    Thanks in advance.
Back to Top