+ 1
Html input value less than 0 not allowed in input type number
Html form input is not allowing me to input a value less than 0 (like 0.5 ) before submitting is there any fix to this
8 Answers
+ 1
Just check if the input is valid before sending it...
As I already mentioned:
***If you need help, please provide an example code.***
+ 1
Thanks alot it worked
0
Use the step attribute.
https://www.w3schools.com/tags/att_input_type_number.asp
If you need help, please provide an example code.
0
Step is used to increment the value ....i tried min and max but only works well for integer whole numbers greater than zero
0
If i use 0.0001 as my min value and 10000 as max ... I wont be able to submit 0.05 or anything 0.
Unless it's exactly 0.0001...
I don't know if its a programmatic bug in html
0
Here is a sample code https://code.sololearn.com/WcSFg7V6BMPv/?ref=app
0
Here is a sample code https://code.sololearn.com/WcSFg7V6BMPv/?ref=app
0
add step attribute, e.g. step="0.001"