Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Casino

    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?

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    This should work:
    Code:
    if (isNaN(Bid))
    {
    alert("some of that charcters you intered are not numbers");
    }
    isNaN stands for is not a number. Here is some more info.

  • #3
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    wow thanks man. That was awful fast to. Ill post the game on here when im done.

  • #4
    New to the CF scene
    Join Date
    Oct 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Attached Files Attached Files


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •