Javascript can have simple validations and such an example is given below. Download and use the code.
<html> <head> </head> <body>functions.jsInput numbers between 0 and 5
</body> </html>
function validate() { var x, text; x = document.getElementById("numb").value; if(isNaN(x) || x < 1 || x > 5) { text = "Input not valid"; }else { text = "Input OK"; } document.getElementById("show").innerHTML = text; }
Comments
Post a Comment