I have a function in js which accepts only floating number, in which regex of floating number is being tested
$(document).ready(function () {
$(".validate-foating-value").keypress(function (e) {
if (!/^[0-9]*\.?[0-9]*$/.test($(e.target).val() + String.fromCharCode(e.which))) {
return false;
}
});
});
its working fine in chrome in Firefox as well but problems I am facing through Firefox are
- backspace not working
- arrow keys not working
- shift+arrow keys for selection and Ctrl+A not working
here is the fiddle.
any other work around for FLOATING numbers?