energoallok
New Member
\[code\]validate document.forms()if document.forms[0].userAge.value http://stackoverflow.com/questions/10256311/=="" alert("Age field cannot be empty." return false;if document.forms[0].userAge.value<5 alert"Your age input is not correct." return false;if userage==isNumber alert"Your age input is not correct." return false; alert"Name and Age are valid." return true <label for="userAge">Age:</label> <input type="text" name="userAge" id="userAge" /> </div>\[/code\]If this is the code I have, how would I make it so that if someone were to enter a non number in the age text box an alert would come up saying " Your input is not correct"?