...

View Full Version : Javascript Casino



JavaScripter
10-30-2004, 11:07 PM
Ok i made the script for the Casino. Now im trying to make money. Im trying to make it so you start out with 10$. And a prompt Box will pop up at the beggining asking for your bid. If you choose "Yes" and the Number is Greater then 0.5. The amount you put in the prompt box will be awareded to you.

NOW, heres my question. How can i make it so if you put in any charcters that arnt numbers then an alert will pop up saying "some of that charcters you intered are not numbers".

heres what i got so far: by the way the variable "Bid" is my prompt Box.

if (Bid != ?) <<<<HERES MY PROBLEM!!
{
alert("some of that charcters you intered are not numbers")
}

Whats the script?

Brandoe85
10-30-2004, 11:39 PM
This should work:


if (isNaN(Bid))
{
alert("some of that charcters you intered are not numbers");
}

isNaN stands for is not a number. Here (http://www.devguru.com/Technologies/ecmascript/quickref/isnan.html) is some more info.

JavaScripter
10-30-2004, 11:46 PM
wow thanks man. That was awful fast to. Ill post the game on here when im done.

JavaScripter
10-31-2004, 12:17 AM
Ok guys this is what I have so far. I Havent gotten the whole Bid thing worked out yet Becauze I dont know how to set it to edit in a certain place. Lol sorry buoght this but Ive only been doin javascript off and on for abuot 2 months now. Im learnin



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum