Wednesday, December 24, 2008

TextBox with numeric input only : textbox, only, numeric, input

function ISonlynumber(evt)
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
<asp:TextBox ID="txtmobileNO" Runat="server" Width="150" MaxLength="64" onkeypress="javascript:return ISonlynumber(event);"></asp:TextBox>

No comments :

Post a Comment

AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath