Hide and Show Problem

2001-05-22 Thread Dinesh Chaturvedi

Hello Friends i am facing a problem.i want to hide and show a text box
(html element )  at run time. using both netscape 4.x and IE 4.x the
problem is it works fine with IE if i use a style sheet with the element
and at run time using java script functions i can say

for hide

document.forms[0].element.style.dispaly=none;

for show

document.forms[0].element.style.dispaly=block;

but when i try to use style with netscape 4.x it does not support style
sheet.
also it is difficult or rather not possible to access a div tag usin
netscape.

CAN any body of you help me find a way out of this problem or can
anybody suggest a newsgroup or place where i can put forward my
problem.please help.i am getting frustrated with the problem i
have tried many ways but 

Dinesh



RE: Hide and Show Problem

2001-05-22 Thread Dinesh Chaturvedi

look this is working fine with ie but not with netscape 4.6 the text
field is not even looking like disabled sort this does not solve my
problem.


-Original Message-
From: Michaƫl Bellefroid [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 2:41 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Hide and Show Problem


I had the same problem and find no way to achieve this under NS.

So I used the following :

function showElement(someTestForVisibility)
if (someTestForVisibility == false) {
document.myformobj.elementToHide.blur();
document.myformobj.elementToHide.value=; // remove
element
content
if(document.all) // IE specific

document.myformobj.elementToHide.style.visibility=hidden;
}
else {
if(document.all) // IE specific

document.myformobj.elementToHide.style.visibility=visible;
}
}

Now, you can put wherever you want a showElement(true) to make it appear
in
IE and
showElement(false) to make it disappear.
More, in the onFocus of the element to hide onFocus=showElement(test)
In IE, the element will disappear if test is false. Under Netscape, the
field won't
disappear but it will be locked

This was used to make a text field appear/disappear if some select box
had a
'OTHER' value.
In the select box, there was an
onChange=showElement(this.value=='OTHER')
and in the
textbox element there was a
onFocus=showElement(document.myformobj.elementToHide.value=='OTHER')

hope this helps.

mikl

-Original Message-
From: Dinesh Chaturvedi [mailto:[EMAIL PROTECTED]]
Sent: mardi 22 mai 2001 10:56
To: [EMAIL PROTECTED]
Subject: Hide and Show Problem


Hello Friends i am facing a problem.i want to hide and show a text box
(html element )  at run time. using both netscape 4.x and IE 4.x the
problem is it works fine with IE if i use a style sheet with the element
and at run time using java script functions i can say

for hide

document.forms[0].element.style.dispaly=none;

for show

document.forms[0].element.style.dispaly=block;

but when i try to use style with netscape 4.x it does not support style
sheet.
also it is difficult or rather not possible to access a div tag usin
netscape.

CAN any body of you help me find a way out of this problem or can
anybody suggest a newsgroup or place where i can put forward my
problem.please help.i am getting frustrated with the problem i
have tried many ways but 

Dinesh



Re: Hide and Show Problem

2001-05-22 Thread William Jaynes

I would do this on the server side by wrapping the text box in a logic
tag.
logic:present name=visibilityFlag
html:text ... \
/logic:present

But perhaps you have a requirement to do it on the client.

- Original Message -
From: Dinesh Chaturvedi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 22, 2001 4:56 AM
Subject: Hide and Show Problem


Hello Friends i am facing a problem.i want to hide and show a text box
(html element )  at run time. using both netscape 4.x and IE 4.x the
problem is it works fine with IE if i use a style sheet with the element
and at run time using java script functions i can say

for hide

document.forms[0].element.style.dispaly=none;

for show

document.forms[0].element.style.dispaly=block;

but when i try to use style with netscape 4.x it does not support style
sheet.
also it is difficult or rather not possible to access a div tag usin
netscape.

CAN any body of you help me find a way out of this problem or can
anybody suggest a newsgroup or place where i can put forward my
problem.please help.i am getting frustrated with the problem i
have tried many ways but 

Dinesh




XBrowser Hide And Show Problem

2001-05-16 Thread Dinesh Chaturvedi

Hello Everybody


I am using a div tag in my html page and trying to hide
and show a text field at run time this works fine while using IE but
when i am using Netscape 4.x.it gives me problem accessing
document.forms[0].divName i have found that in netscape div is not a
part of from abject and used document.divName also but still it is
creating a problemdo anybody of you have a
suggestion.or can anybody tell me where to
consult..

Thanks  Regards

Dinesh 



RE: XBrowser Hide And Show Problem

2001-05-16 Thread GU,JAMES (HP-Corvallis,ex1)

in netscape it is document.layers that contains all the div tags. And it it
also helpful to realize that in netscape every layer itself is a DOM. You
can probably find details in a not-out-of-date Javascript book.

Good luck!

-Original Message-
From: Dinesh Chaturvedi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 2:43 AM
To: [EMAIL PROTECTED]
Subject: XBrowser Hide And Show Problem 


Hello Everybody


I am using a div tag in my html page and trying to hide
and show a text field at run time this works fine while using IE but
when i am using Netscape 4.x.it gives me problem accessing
document.forms[0].divName i have found that in netscape div is not a
part of from abject and used document.divName also but still it is
creating a problemdo anybody of you have a
suggestion.or can anybody tell me where to
consult..

Thanks  Regards

Dinesh