I am trying to validate my form information using javascript. My form has an amount value that must be entered as a number. I am trying to make it so a number must be inputted but I cannot quite get down the issue I am having with my javascript function
<form name="formname" onsubmit="return checkNumInput()" action="nextpage.php" method="post">
function checkNumInput(){
number.constructor;
var amount = document.forms["formname"]["amount"];
if(Number.isNaN(amount.value)){
window.alert("amount must be a number");
amount.focus();
return false;
}
return true;
}