Results 1 to 4 of 4
  1. #1
    Designer Ghostt's Avatar
    Join Date
    Jul 2007
    Location
    Belgium
    Posts
    195

    Javascript / Php question.

    Hiya,
    it's been a while since I last did Javascript, and I've got something that needs to get fixed.

    I have 6 checkboxes (A1/2 - B1/2 - C1/2), and need to make it so only 1 of each letter can be checked.
    So for example:

    A1 ( x )
    A2 ( )
    B1 ( )
    B2 ( x )
    C1 ( )
    C2 ( x )

    I tried doing it by this code:

    PHP Code:
    function resetWorkshop(ichecked)
        {
            
    document.getElementById("workshop"+i).checked checked;
        }
        function 
    changeWorkShop(workshopnr)
        {
            if (
    workshopnr <= 2)
            {
                
    resetWorkshop(1,false);
                
    resetWorkshop(2,false);
            }elseif (
    workshopnr <= 4)
            {
                
    resetWorkshop(3,false);
                
    resetWorkshop(4,false);
            }else
            {
                
    resetWorkshop(5,false);
                
    resetWorkshop(6,false);
             }
            
    resetWorkshop(workshopnr,true);
        } 
    Thanks for help.


  2. #2
    Designer Ghostt's Avatar
    Join Date
    Jul 2007
    Location
    Belgium
    Posts
    195

    Re: Javascript / Php question.

    /Solved

    In javascript
    PHP Code:
    elseif 
    is
    PHP Code:
    else if 
    lol


  3. #3
    Coders
    Join Date
    Nov 2009
    Location
    Belgium
    Posts
    990

    Re: Javascript / Php question.

    Quote Originally Posted by Ghostt View Post
    /Solved

    In javascript
    PHP Code:
    elseif 
    is
    PHP Code:
    else if 
    lol
    Group up some radio buttons? Can't be done easier I guess

  4. #4
    VIP FreckleS's Avatar
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    2,121

    Re: Javascript / Php question.

    I would have said radio buttons but you have fixed anyway, gj
    "The pain you feel today, will be the strength you feel tomorrow"

Similar Threads

  1. Javascript Bots???
    By ynot in forum Beginner
    Replies: 7
    Last Post: September 18th, 2010, 12:20
  2. Vac Ban question
    By boaman in forum Half Life Cheats
    Replies: 2
    Last Post: December 21st, 2008, 19:42
  3. Question
    By Sinister22 in forum Enemy Territory Cheats
    Replies: 12
    Last Post: April 23rd, 2008, 03:47
  4. question
    By Natare in forum Call of Duty 1 Cheats
    Replies: 1
    Last Post: April 6th, 2008, 15:38
  5. Please Little Question
    By Vovo47 in forum Vecs & Scripts
    Replies: 3
    Last Post: April 5th, 2008, 11:18

Bookmarks

Posting Permissions

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