SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Lenexa, KS
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Nested visibility styles

    I want to hide/turn off a whole section of a form. Inside the form itself though, many of the select's, input's, etc. have their own visibility tags. To simplify things, here's some sample code without all the associated javascript:

    <html><body>
    <form>
    <div style='visibility: hidden;'>
    The larger form is here.
    <select name=testing style='visibility: visible;'>
    <option value='made it'>Made it</option>
    </select>
    </div>
    </form>
    </body>
    </html>

    I was hoping that because of the DIV hidden style, the select statement would be hidden as well. But the select's visibility tag takes precedence (which is probably what you want most of the time but just not this time). Is there a way to accomplish this fairly simply? I've thought about defining several classes and then modifying those values as needed with javascript but am looking for a simpler way.

    Of course in my real world page, there are dozens of input tags, lots of JS rules, etc.

    Thanks in advance,
    GaryG

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,264
    Mentioned
    115 Post(s)
    Tagged
    1 Thread(s)
    use display: none when you want to hide the div and display: inline when you want to show it. This will override the visibility tag.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On a <div>, it would make rather more sense to use "display: block" to show it, not inline.

  4. #4
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Lenexa, KS
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BEAUTIFUL!!!! The display option works flawlessly. Thanks!!!


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
  •