<DIV> show/hide...both appear...why oh why?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KathyB

    <DIV> show/hide...both appear...why oh why?

    Hi, totally new to the div show/hide thing.

    I have some rows in a table. When I first load the page, I only want
    to see divs where the divID=ForView. When I load now, I see BOTH
    rows...even though I have one set to style="display= 'none'".

    When I click on the Edit button on a row, I want to hide that row and
    in its PHYSICAL place show the ForEdit div for that item...leaving all
    other divs as is. I've seen some examples, everyone seems to do it
    differently. I'm using ONLY IE5.5 so not worried about multiple
    browsers.

    I will have quite a few of these divs on one page (e.g., Station2,
    Station3, etc.). Would really appreciate any help you can give
    me...remember, I'm new at this!

    Thanks! Kathy

    <div id="ForView_Sta tion1" style="display= 'block'">
    <tr>
    <td>Station One</td>
    <td colspan="2"><in put type="button" name="Edit" value="Edit"
    onclick="showhi de('Station1')" ></input></td>
    </tr>
    </div>

    <div id="ForEdit_Sta tion1" style="display= 'none'">
    <tr>
    <td><input type="text" name="Station One" value="Station One"/></td>
    <td><input type="button" name="SAVE" value="SAVE"></input></td>
    <td><input type="button" name="Cancel" value="Cancel"> </input></td>
    </tr>
    </div>
  • Richard Cornford

    #2
    Re: &lt;DIV&gt; show/hide...both appear...why oh why?

    "KathyB" <KathyBurke40@a ttbi.com> wrote in message
    news:75e8d381.0 309261303.27754 e8e@posting.goo gle.com...
    <snip>[color=blue]
    > <div id="ForView_Sta tion1" style="display= 'block'">[/color]
    <snip>

    The string specified for a STYLE attribute should be in CSS syntax.

    Richard.


    Comment

    • Kathy Burke

      #3
      Re: &lt;DIV&gt; show/hide...both appear...why oh why?

      Richard,

      Could you please show me? I've copied all the examples I've seen...so I
      don't understand what you mean...

      thanks.

      also, CAN I do <div>s by row like I've done? Or does it have to be some
      other way?

      Kathy

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • johkar

        #4
        Re: &lt;DIV&gt; show/hide...both appear...why oh why?

        Your style syntax should be: style="display: none"

        Also, delete all your div tags as they are incorrect syntax. To do what
        you want, just put the ID and style in the TR tag. If you have an ID that
        spans multiple rows, you can use the <tbody></tbody> tag to surround the
        rows in question (add your ID & style to tbody). You can have as many tbody
        tags in a table as you like.

        If you really want to get into it, instead of using inline styles, you could
        just declare a style rule in the head and assign it as needed in the table.
        Once you have this working. The question might be, how can I accomplish
        this without creating hidden rows? There are many ways to do this.

        Good luck,

        John

        "KathyB" <KathyBurke40@a ttbi.com> wrote in message
        news:75e8d381.0 309261303.27754 e8e@posting.goo gle.com...[color=blue]
        > Hi, totally new to the div show/hide thing.
        >
        > I have some rows in a table. When I first load the page, I only want
        > to see divs where the divID=ForView. When I load now, I see BOTH
        > rows...even though I have one set to style="display= 'none'".
        >
        > When I click on the Edit button on a row, I want to hide that row and
        > in its PHYSICAL place show the ForEdit div for that item...leaving all
        > other divs as is. I've seen some examples, everyone seems to do it
        > differently. I'm using ONLY IE5.5 so not worried about multiple
        > browsers.
        >
        > I will have quite a few of these divs on one page (e.g., Station2,
        > Station3, etc.). Would really appreciate any help you can give
        > me...remember, I'm new at this!
        >
        > Thanks! Kathy
        >
        > <div id="ForView_Sta tion1" style="display= 'block'">
        > <tr>
        > <td>Station One</td>
        > <td colspan="2"><in put type="button" name="Edit" value="Edit"
        > onclick="showhi de('Station1')" ></input></td>
        > </tr>
        > </div>
        >
        > <div id="ForEdit_Sta tion1" style="display= 'none'">
        > <tr>
        > <td><input type="text" name="Station One" value="Station One"/></td>
        > <td><input type="button" name="SAVE" value="SAVE"></input></td>
        > <td><input type="button" name="Cancel" value="Cancel"> </input></td>
        > </tr>
        > </div>[/color]


        Comment

        Working...