HTML/CSS/JavaScript: Hide a textfield
Okay, in FireFox (browser supreme) it not only allows me to make the textfield invisible but also reduce the height to 0px so that there is no white space and everthing shifts up accordingly.
However, IE (devil spawn) will simply not allow this. It hides the field but there is still space where it is! So, in my case where I want to hide 20 fields on a form there is instead a mass of white space that looks extremely messy :mad:
Any ideas on how to reduce the height of a textfield in IE to 0 pixels??
Re: HTML/CSS/JavaScript: Hide a textfield
Have you tried changing the style of the textbox to display:none
Re: HTML/CSS/JavaScript: Hide a textfield
Quote:
Originally Posted by DeadEyes
Have you tried changing the style of the textbox to display:none
Yes, that would be the best idea :)
Code:
<script type="">
<!--
var MyTextbox = document.getElementById("Textbox ID Goes Here");
MyTextbox.style.display = "none";
//-->
</script>
And to show it you would just do this:
Code:
MyTextbox.style.display = "inline";
Cheers,
RyanJ