Input field onkeyup check floating values only to allow
onkeyup="if (!isFinite(this.value)) this.value = this.value.replace(/(\s+)?.$/,'')"
onkeyup="if (!isFinite(this.value)) this.value = this.value.replace(/(\s+)?.$/,'')"
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
$('#price').keyup(function(e){
var entered_value = $(this).val();
var regexPattern = /^\d{0,8}(\.\d{1,2})?$/;
//Allow only Number as well 0nly 2 digit after dot(.)
if(regexPattern.test(entered_value)) {
alert("false") ;
} else {
alert("true");
}
});
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Feet/Inches ⇄...