• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help :::Allow user to enter only numeric value

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.)
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic