SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Dublin
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hidden & visible problem

    Hi, I'm trying to make a textbox invisible originally.......

    <td><input type="hidden" name="price" id="price"/></td>

    and then visible on a submission......

    document.getElementById('price').style.visibility="visible";


    However it doesn't work.


    I can however do the opposite. Any ideas?

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,276
    Mentioned
    119 Post(s)
    Tagged
    1 Thread(s)
    That's because there is displaying of hidden fields. What you can do alternatively is using something like:

    <td><input type="text" name="price" id="price" style="display:none" /></td>

    then your javascript line would be:
    document.getElementById('price').style.display="block";

    Note - this is a quick example. The display:none should really be in a class with the class assigned to the field instead of styled inline like this.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse


Bookmarks

Posting Permissions

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