I would like to always have a float value with a dot (not a semicolon) on my inputs.
<input type="text" class="dot"> <br /> <input type="text" class="dot"> <br /> <input type="text" class="dot"> <br /> $('.dot').keydown(function(){ $(this).val($(this).val().toString().replace(/\,/g, '.')); })
replace the comma with a dot, but it should not be> 1 dot and others ... It should only be accepted [0-9] and.
if I find a different value than the others [0-9] and. then this value should be deleted - ".".
How can i do this?
http://jsfiddle.net/ZtkBW/
javascript jquery
Tony evyght
source share