I've got a RadPanelBar with four different RadPanelItem's. Each one has a different type of search form with it's own search button. The whole thing is contained within a master page. What I'd like to do is capture the Enter key within each RadPanel so that it executes the click on the correct button, depending on where the cursor is.
Here's a quick example of what my code looks like:
One minor twist: the master page has a quick search field in it and the enter key is captured there using the "defaultbutton" attribute on the form tag...
Thanks for the help!
Eddie
Here's a quick example of what my code looks like:
| <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="260px" ExpandMode="SingleExpandedItem"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Text="Login"> |
| <Items> |
| <telerik:RadPanelItem runat="server"> |
| <ItemTemplate> |
| <div style="line-height: 16px; padding: 4px; width:230px;"> |
| <div class="LoginBox"> |
| <div style="float: left; width: 80px; padding-top:3px;"> |
| Username:</div> |
| <div style="margin-top: 4px;"> |
| <asp:TextBox runat="server" ID="txtUsername" Text="" Width="70px"></asp:TextBox></div> |
| <div style="float: left; clear: both; width: 80px; "> |
| Password:</div> |
| <asp:Button runat="server" ID="btnLogin" Text="Login" Style="float: right; margin: 5px 5px 10px 0px; clear: both" |
| OnClick="btnLogin_Click" /> |
| </div> |
| </div> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| <telerik:RadPanelItem runat="server" Text="CH Search" Value="CHSearch"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Value="CHSearchContent"> |
| <ItemTemplate> |
| <div style="line-height:16px; padding:7px;"> |
| <div style="float:left; width:70px;">ID: </div> |
| <div style="float:left; vertical-align: middle"><asp:TextBox Width="130px" runat="server" ID="txtCHID"></asp:TextBox></div> |
| <div style="float:left; clear:both; width:70px;">Reason: </div> |
| <div style="float:left; vertical-align: middle"><asp:TextBox Width="130px" runat="server" ID="txtCHReason"></asp:TextBox></div> |
| <div style="clear:both; float: left; text-align:left; margin-left:34px; padding-bottom:10px; vertical-align: middle"> |
| <asp:Button runat="server" ID="btnCHSubmit" Text="Search" OnClick="btnCHSearch_Click" /> |
| </div> |
| </div> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| <telerik:RadPanelItem runat="server" Text="WP Search" Value="WPSearch"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Value="WPSearchContent"> |
| <ItemTemplate> |
| <div class="wpSearchForm"> |
| <div style="float:left; clear:both; width:70px;">First Name: </div> |
| <div style="float:left; vertical-align: middle"> |
| <asp:TextBox runat="server" ID="txtWPFname" Width="130px"></asp:TextBox></div> |
| <div style="float:left; clear:both; width:70px;">Last Name: </div> |
| <div style="float:left; vertical-align: middle"><asp:TextBox runat="server" Width="130px" ID="txtWPLname"></asp:TextBox></div> |
| <div style="clear:both; float:left; width:70px;">Sex: </div> |
| <div style="float:left; vertical-align: middle"> |
| <asp:DropDownList runat="server" ID="drpWPSex"> |
| <asp:ListItem Text="" Value=""></asp:ListItem> |
| <asp:ListItem Text="M" Value="M"></asp:ListItem> |
| <asp:ListItem Text="F" Value="F"></asp:ListItem> |
| </asp:DropDownList> |
| </div> |
| <div style="float: left; clear: both; width: 70px;">Password: </div> |
| <div style="float:left; vertical-align: middle"><asp:TextBox runat="server" Width="130px" ID="txtWPPassword" TextMode="password"></asp:TextBox></div> |
| <div style="clear:both; float: left; text-align:left; margin-left:34px; padding-bottom:10px; vertical-align: middle"> |
| <asp:Button runat="server" ID="btnWPSubmit" Text="Search" OnClick="btnWPSearch_Click" /> |
| </div> |
| </div> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
One minor twist: the master page has a quick search field in it and the enter key is captured there using the "defaultbutton" attribute on the form tag...
Thanks for the help!
Eddie