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