Reputation: 1357
I have a div where I want the user to input a number that is between 0.05 and 0.5. I did it this way:
<input id="TS_dist" class="tableButton" type="number" maxlength="1" size="5" value="0.2" />
The problem is that when I am puting a value I cannot use the zero, it is not working, the . is not either. Only 1-9 numbers are accepted.
My browser is firefox.
Do you have any idea what I am doing wrong?
Thanks
Upvotes: 0
Views: 67
Reputation: 103348
By default the value increases/decreases by 1. Add a step
attribute to change this behaviour:
<input step="0.05" id="TS_dist" class="tableButton" type="number" maxlength="1" size="5" value="0.2" />
http://jsfiddle.net/uh44h3y8/1/
Upvotes: 1