+5

Why input tag of type number takes two .. (Double dot)as input and consider as valid?

Please give me solution having input type number with fraction as well as decimal input and it should not accept any other value while typing in input tag uptil 6 digit

2/25/2020 6:56:34 PM

Shivraj pattanshetti

7 Answers

New Answer

+3

You could write some JavaScript code to validate the input. Or you can use min and max attributes. https://www.w3schools.com/tags/att_input_type_number.asp [EDIT] I think Rafael S P Valle da Silva hit the nail on the head. I didn't think about how the comma and dot are reversed in some locals. Nice! I see you Downvoter...nice that you downvote someone for trying to help very SOish of you. [EDIT] the downvoter is gone, they tend to vanish when you call them out 😂

+3

Thanks you I will check that

+3

Rafael S P Valle da Silva thank you, I saw I had your upvote, and I thank you for that. But you understood what was being asked and gave the needed input. Thank you for helping. I noticed someone had downvoted. I don't do it because it is not constructive. I think it's better to post a comment with constructive criticism.

+1

Hi!! Please, see this link. I think maybe is useful: https://stackoverflow.com/questions/6178332/force-decimal-point-instead-of-comma-in-html5-number-input-client-side

+1

Paul, you have my upvote. That was a good "light" to find the answer.

+1

+1