Thread: Number control
View Single Post
03-13-2009, 06:25 AM
#3
rkquest is offline rkquest
rkquest's Avatar
Status: I'm new around here
Join date: Nov 2008
Location:
Expertise:
Software:
 
Posts: 18
iTrader: 0 / 0%
 

rkquest is on a distinguished road

  Old

This will give you an idea..

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Gissa numer</title>

</head>
<body>

<form action="" method="post">
<input name="guess" type="text">
<input name="knapp" type="submit" value="Guess">

</form>

<script type="text/javascript">
	document.forms[0].knapp.onclick = function() {
		var theNumber = document.forms[0].guess.value;
		if (theNumber>=0 && theNumber<=100) {
			return true;
		} else {
			alert("You don't know how to follow instructions, moron!");
			return false;
		}
	}
</script>

</body>
</html>