Hide and Show

Discussion in 'Javascript' started by Louise Woodward, Oct 27, 2003.

  1. I have a table with 20 rows and I have a label on a form that I would like
    to hide and show and this label can be on certain rows - this is row2

    I have tried using Form1.MinLabel2.style.display = ""; or "none" and it
    comes up with the error Form1.MinLabel2.sytle is null or not an object

    Can I do this with a label or just input boxes ??
    Why is this ??
     
    Louise Woodward, Oct 27, 2003
    #1
    1. Advertising

  2. Louise Woodward

    W d'Anjos Guest

    You should be able to do this with labels also. Please post your
    code, I think there is something wrong on the label definition.

    -Wagner

    "Louise Woodward" <> wrote in message news:<UW8nb.1587$>...
    > I have a table with 20 rows and I have a label on a form that I would like
    > to hide and show and this label can be on certain rows - this is row2
    >
    > I have tried using Form1.MinLabel2.style.display = ""; or "none" and it
    > comes up with the error Form1.MinLabel2.sytle is null or not an object
    >
    > Can I do this with a label or just input boxes ??
    > Why is this ??
     
    W d'Anjos, Oct 27, 2003
    #2
    1. Advertising

  3. Louise Woodward

    Lee Guest

    W d'Anjos said:

    >"Louise Woodward" <> wrote in message
    >news:<UW8nb.1587$>...
    >> I have a table with 20 rows and I have a label on a form that I would like
    >> to hide and show and this label can be on certain rows - this is row2
    >>
    >> I have tried using Form1.MinLabel2.style.display = ""; or "none" and it
    >> comes up with the error Form1.MinLabel2.sytle is null or not an object
    >>
    >> Can I do this with a label or just input boxes ??
    >> Why is this ??


    >You should be able to do this with labels also. Please post your
    >code, I think there is something wrong on the label definition.


    No, you shouldn't be able to refer to labels as elements of a form.
    In fact, you shouldn't be able to refer to a form simply as "Form1",
    but some browsers will let you get away with that.

    document.getElementById("MinLable2").style.display
     
    Lee, Oct 27, 2003
    #3
  4. my label is just <label id="minlabel2">minimum label</label>


    "W d'Anjos" <> wrote in message
    news:...
    > You should be able to do this with labels also. Please post your
    > code, I think there is something wrong on the label definition.
    >
    > -Wagner
    >
    > "Louise Woodward" <> wrote in message

    news:<UW8nb.1587$>...
    > > I have a table with 20 rows and I have a label on a form that I would

    like
    > > to hide and show and this label can be on certain rows - this is row2
    > >
    > > I have tried using Form1.MinLabel2.style.display = ""; or "none" and it
    > > comes up with the error Form1.MinLabel2.sytle is null or not an object
    > >
    > > Can I do this with a label or just input boxes ??
    > > Why is this ??
     
    Louise Woodward, Oct 28, 2003
    #4
  5. Louise Woodward

    W d'Anjos Guest

    Since you have multiple labels on your form, Form1.MinLabel2 is an array. Try:

    if (Form1.MinLabel2.length){ // tests if MinLabel2 has mutiple instances
    for (i=0; i < Form1.MinLabel2.length; i++)
    Form1.MinLabel2.style.display = "none";
    }else{
    Form1.MinLabel2.style.display = "none";
    }

    I hope this helps.

    Wagner

    "Louise Woodward" <> wrote in message news:<gFqnb.1590$>...
    > my label is just <label id="minlabel2">minimum label</label>
    >
    >
    > "W d'Anjos" <> wrote in message
    > news:...
    > > You should be able to do this with labels also. Please post your
    > > code, I think there is something wrong on the label definition.
    > >
    > > -Wagner
    > >
    > > "Louise Woodward" <> wrote in message

    > news:<UW8nb.1587$>...
    > > > I have a table with 20 rows and I have a label on a form that I would

    > like
    > > > to hide and show and this label can be on certain rows - this is row2
    > > >
    > > > I have tried using Form1.MinLabel2.style.display = ""; or "none" and it
    > > > comes up with the error Form1.MinLabel2.sytle is null or not an object
    > > >
    > > > Can I do this with a label or just input boxes ??
    > > > Why is this ??
     
    W d'Anjos, Oct 28, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RA
    Replies:
    1
    Views:
    4,051
  2. Shapper

    Hide and Show Div on Page_Load

    Shapper, May 20, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    12,574
  3. Shapper

    Image Button and Show/Hide Panel

    Shapper, Sep 21, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    10,340
    Shapper
    Sep 21, 2005
  4. Ather Ali Shaikh

    Q. About Show and Hide Edit and Delete Buttons

    Ather Ali Shaikh, Oct 16, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    145
    Ather Ali Shaikh
    Oct 16, 2003
  5. ll
    Replies:
    2
    Views:
    684
    Thomas 'PointedEars' Lahn
    May 1, 2008
Loading...

Share This Page