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

ClientKeyPressing event in firefox

2 Answers 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Immanuel
Top achievements
Rank 1
Immanuel asked on 15 Dec 2008, 03:29 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2008, 12:42 PM
Hi Immanuel,

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

Regards
Shinu

0
Immanuel
Top achievements
Rank 1
answered on 16 Dec 2008, 02:11 PM

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.
Tags
TreeView
Asked by
Immanuel
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Immanuel
Top achievements
Rank 1
Share this question
or