简体   繁体   中英

How to keep leading zeros in Firefox and Safari

I have the issue with the form number field with firefox and safari (and possibly opera, I have not tested it in that). When I put an initial value in the number field that contains leading zeros, firefox and safari remove them. Is there any way to get them to show the leading zeros? This is on a php file and is already using jquery, so I am open to using any method that would work without changing file type.

Ex: Initial Value (needs to be shown): 0034861

Firefox and Safari Display: 34861

You can use input type="tel" to fix this altogether.

Although ideally if you are having leading zeroes, it is advisable to use type="text" and not number.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM