Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Hide and Show

Reply
Thread Tools

Hide and Show

 
 
Louise Woodward
Guest
Posts: n/a
 
      10-27-2003
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 ??



 
Reply With Quote
 
 
 
 
W d'Anjos
Guest
Posts: n/a
 
      10-27-2003
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" <(E-Mail Removed)> wrote in message news:<UW8nb.1587$(E-Mail Removed)>...
> 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 ??

 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      10-27-2003
W d'Anjos said:

>"Louise Woodward" <(E-Mail Removed)> wrote in message
>news:<UW8nb.1587$(E-Mail Removed)>...
>> 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

 
Reply With Quote
 
Louise Woodward
Guest
Posts: n/a
 
      10-28-2003
my label is just <label id="minlabel2">minimum label</label>


"W d'Anjos" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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" <(E-Mail Removed)> wrote in message

news:<UW8nb.1587$(E-Mail Removed)>...
> > 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 ??



 
Reply With Quote
 
W d'Anjos
Guest
Posts: n/a
 
      10-28-2003
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[i].style.display = "none";
}else{
Form1.MinLabel2.style.display = "none";
}

I hope this helps.

Wagner

"Louise Woodward" <(E-Mail Removed)> wrote in message news:<gFqnb.1590$(E-Mail Removed)>...
> my label is just <label id="minlabel2">minimum label</label>
>
>
> "W d'Anjos" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > 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" <(E-Mail Removed)> wrote in message

> news:<UW8nb.1587$(E-Mail Removed)>...
> > > 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 ??

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
show hide divs - show last state upon reload/post ll Javascript 2 05-01-2008 12:15 PM
Hide and Show Div on Page_Load Shapper ASP .Net 3 05-20-2005 02:34 PM
[HIDE LAN] Hide a part of hosts into the LAN at VPN users? Paolo Bresi Cisco 1 04-04-2005 02:41 PM
How to hide table rows and show them when user click a different row? RA ASP .Net 1 02-19-2004 10:53 PM
Q. About Show and Hide Edit and Delete Buttons Ather Ali Shaikh ASP .Net Datagrid Control 0 10-16-2003 06:26 AM



Advertisments