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

Posted on December 24, 2008. Filed under: JavaScript |

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>

Make a Comment

Make a Comment: ( None so far )

blockquote and a tags work here.

    About

    Hi,I am Suresh Sharma from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...