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

Validation For A Number using Regular Expression

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi All ,

Please someone provide the javascript code for validation of a input number .


Conditions -

If we input like 0005 ,it should throw error ,but if we input 5 it should not throw any error (It means zeroes are not allowed before any number) .


If we input 0,it should not throw any error (Single zero is allowed ).


It will be very helpful if someone provides validation code with checking zeroes from the beginning with the help of Regular Expression



 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Duplicate...please close

https://coderanch.com/t/539227/HTML-JavaScript/Validation-input-number-Java-script

 
    Bookmark Topic Watch Topic
  • New Topic