Try this.....

Im not that good with Javascript, but this might work...

Instead of using a While condition, use an IF ELSE statement, so you have:

IF (userNumber >= upperLimit)
{
UserInput = window.prompt('Please re-enter - number should be in range 1 to + upperLimit, '')

userInput = window.prompt('Please enter a number in the range 1 to ' + upperLimit,'');
userNumber = parseFloat(userInput);
}
ELSE
{
document.write(''+'Your chosen number was ' + yourNumber)
}

Posted By: Trent_Canary on May 27th 2007 at 14:22:41


Message Thread


Reply to Message

In order to add a post to the WotB Message Board you must be a registered WotB user.

If you are not yet registered then please visit the registration page. You should ensure that their browser is setup to accept cookies.

Log in