Forum Moderators: open

Message Too Old, No Replies

Dynamically hiding a textbox

Dynamically hiding a textbox

         

sireesha

8:31 am on Jan 14, 2004 (gmt 0)

10+ Year Member



Is there a way to show/hide a textbox without using DIV/layer tag as in IE and Netscape. As these tags do not work in all the browsers.

BlobFisk

11:29 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried assigning a class/id to it and seeing if visibility:hidden; or display:none work?

I've never tried this, so I'm not sure...

BlobFisk

11:38 am on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi sireesha,

I've just tested this with Opera7.21 and IE6 and you can dynamically hide and how an input box:

<style type="text/css">
#datext {visibility:hidden;}
</style>

<input type="text" id="datext"><br>
<a href="#" onClick="document.getElementById('datext').style.visibility='visible';">show me</a>

Toggles the visibility and shows the input box. By using the code above you can write a small function that will show and hide the visibility.

HTH

sireesha

2:27 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



Hi all,
Is there any code which is compatible with both Netscape and IE? and similarly other browsers?

BlobFisk

2:58 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is - the code outlined in this thread [webmasterworld.com] is a cross browser version of above.

HTH