Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
176
rated 0 times [  178] [ 2]  / answers: 1 / hits: 62939  / 9 Years ago, wed, june 3, 2015, 12:00:00

I noticed that if i use <input type=number /> the leading zeros are not removed. I also saw a lot of discussion on how keeping leading zeros.



For example 000023 and 23 are the same number and i think that it doesn't make sense keeping those zeros.


More From » html

 Answers
10

just use a regular expression like this



textboxText= textboxText.replace(/^0+/, '')

[#66344] Tuesday, June 2, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarettajb

Total Points: 678
Total Questions: 94
Total Answers: 90

Location: Guernsey
Member since Tue, Jul 6, 2021
3 Years ago
;