SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hiding a table row based on radio button selection

    Hi,

    I'm looking to hide/display certain table rows based on which radio button is selected. I've found some code that does this using checkboxes, but I need radio buttons (only one selection allowed) and I can't seem to get it to work.

    Does anyone know of such a script?

    Thanks in advance !
    Sincerely,

    Eirik Johansen
    Netmaking AS

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    check out the dHTML tutorials/scripts at my site (GrassBlade). BTW: the only diff between checkbox & radio button is the latter is an array.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not true Vinny - checkboxes are arrays too (provided you have two or more with the same name). Otherwise, they are just single elements. Likewise, a single radio button is a single element, and not a 1-length array.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Beetle,

    True, but exceptions to the norm are exceptions. People are not used to seeing a solitary radio button; nor would they understand an array of checkboxes. Common usage says a checkbox is used for solitary things that have no opposite -- you either want it or you don't. Radio buttons are usually used for mutually exclusive things -- male/female, on/off, screaming/loud/normal/soft/whisper. So yes, technically I fudged, but...

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Vincent Puglia
    Common usage says a checkbox is used for solitary things that have no opposite
    Uhhh, I disagree. Checkboxes are more commonly used in groups than in singles. Such as your private messages, or registering a domain name. Basically, in this way they act much like a multipleSelect, but have great scanability and flexibility of presentation.

    Yes, I realize that checkboxes are often used for "I Agree to these Terms" scenarios, but I've seen two radio buttons used for such binary situations as well, such as Google's Advanced Search (see the SafeSearch setting).

    I'm not suggesting that radio-buttons should be use in single, just merely stating that checkboxes aren't always so.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •