"Samuel Shulman" <sa************@ntlworld.comwrote in message
news:O$**************@TK2MSFTNGP05.phx.gbl...
<asp:TextBox ID="txtCarat" runat="server" TabIndex="38" Width="28px"
onkeypress="return NumericOnly(event);"></asp:TextBox>
I tried to code this line to filter the none numeric characters typed into
the textbox but it doesn't accepts it
<asp:TextBox is a server-side control - the avboe try to run a server-side
method called OnKeyPress...
What is the syntax for JavaScript?
In your page's Page_Load event:
txtCarat.Attributes.Add("onKeyPress", "return NumericOnly(event);");