Using the following code with jQuery:
$(\'#from-amount\').keypress(function(event) {
if ((event.which != 46 || $(this).val().indexOf(\'.\') != -1) &&
Try this
$('#from-amount').keypress(function(event) {
if (((event.which != 46 || (event.which == 46 && $(this).val() == '')) ||
$(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
event.preventDefault();
}
}).on('paste', function(event) {
event.preventDefault();
});
https://jsfiddle.net/4rsv960t/1/