the html is better ))
as for javascript... my english is not good. it seems i used wrong word when wrote about "pair". i think it would be much better if somebody explain everything to you in right good english
anyway, here is the code which works:
Code:
<!DOCTYPE html>
<html>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
<title>enter you number</title>
<script type="text/javascript">
function formValidator(){
var max = 99;
var min = 1;
var val = parseInt(document.forms['myform'].elements['firstname'].value);
var res = document.getElementById('result');
if((val <= min) || (val >= max)){res.innerHTML = "Wrong number!";}
else{res.innerHTML = "The number is between 1 and 99";}
}
</script>
</head>
<body>
<center>
<hr />
<h1>enter your number</h1>
<hr />
<p>Note: all fields are mandatory.</p>
<form name="myform">
enter number between 1-99999: <input type="text" name="firstname" />
<br /><br />
<input type="button" value="Check it up" onclick="formValidator()" />
<br /><br />
<div id="result"></div>
</form>
</center>
</body>
</html>
Last edited by Padonak; 04-26-2012 at 03:39 PM.
use [code]YOUR CODE GOES HERE[/code] or burn in Hell
Bookmarks