Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: switch program problem check my program and help how to fix

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default switch program problem check my program and help how to fix

    <HTML>
    <HEAD>
    <script>

    function zaba(){
    var number1st;

    var number1st = prompt("Please enter drill size or number","") ;
    number1st = parseFloat(number1st);


    switch (number1st) {

    // it work properly
    case (80):
    alert (" answer is 0.0135" );
    break;

    // it work properly
    case (0.5):
    alert (" answer is 0.5 " );
    break;

    // why do not work properly
    case (1/2):
    alert (" answer is 0.5 " );
    break;

    // why do not work properly
    case (A):
    alert (" answer is 0.350 " );
    break;

    // why do not work properly
    case (b):
    alert (" answer is 0.450" );
    break;

    if (number1st != null && number1st != "")
    {
    return number1st;
    }
    }
    }
    </script>
    </HEAD>
    <BODY>

    <input type="radio" name="radio1" value="two" onclick="zaba()">one
    <input type="radio" name="radio1" value="three" onclick="zaba()">two
    <input type="hidden" name="hidden1" value="name">
    </BODY>
    </HTML>


  2. #2
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: switch program problem check my program and help how to fix

    Java != Java Script.

    You may get help in the "other programming languages sub forum.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: switch program problem check my program and help how to fix

    Thread moved from What's Wrong With My Code?

Similar Threads

  1. How to fix this class/program
    By profit7 in forum Collections and Generics
    Replies: 3
    Last Post: May 29th, 2013, 08:53 AM
  2. can anyone help me to fix the error in the program???
    By divi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 24th, 2013, 02:49 PM
  3. [SOLVED] How can i fix and run my program?? Please help..
    By BeginCode in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 7th, 2012, 08:03 PM
  4. How do I fix my program?
    By mjballa in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 15th, 2011, 01:00 AM
  5. can u guys help me fix my program
    By nima9006 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 14th, 2010, 03:43 AM

Tags for this Thread