Good Day Admin
i have a Tool bar that is defined like this
and i have a property that i will use to access the value of the textbox like this
now the property is working and fine and now in my Client side code i access the value of the textbox ,but i have a keypress event for that textbox that is defined like this on the clientside
now my problem is that the keypress event does not get fired when the textbox is in the toolbar
Thanks
i have a Tool bar that is defined like this
<telerik:RadToolBar ID="RadToolBar1" Runat="server" EnableViewState="False" Height="100%" Skin="Forest" Width="100%"> <Items> <telerik:RadToolBarButton Width="100%" runat="server" Text="Button1"> <ItemTemplate> <asp:TextBox ID="txtsearch" runat="server" CssClass="imgButtonRight" onkeypress="keyPress()" Font-Size="X-Large" Height="40px" Width="650px"></asp:TextBox> </ItemTemplate> </telerik:RadToolBarButton> </Items> </telerik:RadToolBar>and i have a property that i will use to access the value of the textbox like this
public String txtsearchid{ get { RadToolBarItem textItem = RadToolBar1.FindItemByText("Button1"); TextBox txtseach = (TextBox)textItem.FindControl("txtsearch"); return txtseach.ClientID; }}now the property is working and fine and now in my Client side code i access the value of the textbox ,but i have a keypress event for that textbox that is defined like this on the clientside
<script type="text/javascript"> function keyPress() { var tb = document.getElementById('Text1'); var txtsearch = document.getElementById("<%=txtsearchid%>"); if (txtsearch.nodeValue.length <= 2) { PageMethods.Getadata(document.getElementById(txt2).value, myFunction); alert(msg); } return false; } function myFunction(msg) { }</script>now my problem is that the keypress event does not get fired when the textbox is in the toolbar
Thanks