Results 1 to 3 of 3

Thread: HTML/CSS/JavaScript: Hide a textfield

  1. #1

    Thread Starter
    Fanatic Member Valleysboy1978's Avatar
    Join Date
    Nov 2004
    Location
    Planet Xeoroaniar CC Posts:1,928,453,459,361
    Posts
    770

    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

    Any ideas on how to reduce the height of a textfield in IE to 0 pixels??
    Life is one big rock tune

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: HTML/CSS/JavaScript: Hide a textfield

    Have you tried changing the style of the textbox to display:none

  3. #3
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    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
    My Blog.

    Ryan Jones.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width