I have an assignment with loads of javascript stuff to do and it is all fairly basic, but programming of any sort I cannot get my head round it. Anyone able to give me a hand? First Problem: <HTML> <HEAD> Enter a number <TITLE>Questionn 1 (ii)(a) </TITLE> <SCRIPT LANGUAGE = "JavaScript" > var userNumber; var upperLimit = 20; userNumber = window.prompt('Please enter a number in the range 1 to ' + upperLimit, ''); userNumber = parseFloat(userNumber); while (userNumber < 1 || userNumber > upperLimit) { UserNumber = window.prompt('Please re-enter - number should be in range 1 to ' + upperLimit, ''); userNumber = parseFloat(userNumber) }; document.write('<BR>'+'Your chosen number was ' + userNumber) </SCRIPT> </HEAD> <BODY> </BODY> </HTML> For some reason this keeps getting stuck in a continous loop. If I enter a number between 1 and 20 it writes it, but then I enter a number outside the range, popup box appears (like its meant to), so then re-enter number inside range and popup box keeps appearing.
You should try posting here http://www.neofriends.net/phpBB2/viewforum.php?f=14 you might get a better response