aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes help :::Allow user to enter only numeric value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "help :::Allow user to enter only numeric value" Watch "help :::Allow user to enter only numeric value" New topic
Author

help :::Allow user to enter only numeric value

Sanjay pts
Ranch Hand

Joined: Nov 07, 2000
Posts: 357
Hello
can anybody tell me how i should enable user to enter only numeric value for html field telephone number.
I have a one text field in which i have to enable user to enter only numeric value, means not allow him to enter alphbetics.If user press letter 'a' to 'z' or any extra character it should not display on text box.Please send me this code.
Thanx
sanjay Patel


Eat JAVA, Drink JAVA, Sleep Java
Joe Paolangeli
Ranch Hand

Joined: Apr 05, 2000
Posts: 73
View the following posts at JavaRanch:
http://www.javaranch.com/ubb/Forum20/HTML/000126.html http://www.javaranch.com/ubb/Forum20/HTML/000142.html
Here is another link: http://javascript.internet.com/forms/block-key-press.html
Sanjay pts
Ranch Hand

Joined: Nov 07, 2000
Posts: 357
I had gone through the link, that code works fine into IE but not with NS. please help me out if you know the code for both browser.
Thanx
sanjay patel
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
What you actualy wanna do, is handle onKeyPress event. It is different for IE 4/5, NS4 and NS6. Check out http://webreference.com/js/. (I don't want retype it.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help :::Allow user to enter only numeric value