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: How do I make this just numbers

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

    Red face How do I make this just numbers

    if (document.ExamEntry.subject.value=="") {
    msg+="You must enter the exam number \n";
    document.ExamEntry.subject.focus();
    document.getElementById('number').style.color="red ";
    result = false;
    }
    if(msg==""){
    return result;
    }
    Last edited by Lulu-lala; October 6th, 2014 at 06:33 AM. Reason: It's solved


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 697 Times in 679 Posts

    Default Re: How do I make this just numbers

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Please post your code correctly per the above link.

    A common theme today: Don't use '==' to compare String objects. Use the equals() method instead.

  3. #3
    Junior Member
    Join Date
    Jul 2013
    Posts
    8
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Is this JavaScript from a controlled assessment from OCR GCSE Computing??

Similar Threads

  1. Replies: 0
    Last Post: January 4th, 2014, 02:25 PM
  2. Replies: 3
    Last Post: November 18th, 2013, 11:55 AM
  3. Replies: 4
    Last Post: February 10th, 2013, 11:58 PM
  4. How can I make a JDialog to make main Frame to "sleep"
    By piulitza in forum AWT / Java Swing
    Replies: 1
    Last Post: May 11th, 2012, 08:00 AM
  5. [METHOD] How: Count how many prime numbers there is between two numbers!
    By Secret20 in forum Object Oriented Programming
    Replies: 4
    Last Post: October 18th, 2011, 02:30 PM

Tags for this Thread