SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Hide a textarea

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am looking for a good way to hide a text area. I have hidden it in IE using CSS, but that doesn't work for Netscape. Does anyone have any ideas.

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    stupid question, but why would you need to hide a text area? Are you doing it for a "show/hide" layers thing?
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stupid answer

    I need to post a long html string and the comments inside the string break the hidden field. So basically if it isn't in a textarea it just puts that html on the page.

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok...a few options would be:

    1) Make that particular string of text the same color as the background.

    2) With comment tags, you will be safe just leaving it out on the page. No need for an input tag.

    3) Put the comment tags outside the <textare> tag itself.

    Of course, there could be something else you are trying to accomplish and if that is the case then just tell me to shut the hell up...

    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Kinda

    Well, I need to post the html string, so it has to be in a form element. I have tried css, works in ie not nn. The only other thing I can think of doing is using HTMLEncode(), this is an asp project, on the string, but I keep getting type mismatch errors.

  6. #6
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you're trying to post a form and send a value that contains html code, yes?

    The hidden form field shouldn't be breaking on the comments...the problem is likely with other characters such as quotes or < >. You could run your string through a JavaScript that replaces all instances of special characters with their character code. So... " gets replaced with &#34;.

    There are a few thousand scripts out there that accomplish this. Personally, I'd avoid messing around with a hidden textarea.

  7. #7
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops...

    " would get replaced with it's character code, which is
    # & 34;

  8. #8
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    You put you finger on it

    that is the crux of the problem. This is an asp script that I am trying to build. So I would like to use a VBScript function called HTMLEncode() that does what you are talking about. Only I keep getting mismatch errors when I try it. But, that is a post for another forum.
    Thanks for your help
    Thanks Creole

  9. #9
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Orlando
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would hiding the textarea by dropping a layer on top of it work for you?
    Andy
    www.avaronweb.com

  10. #10
    SitePoint Zealot
    Join Date
    Mar 2001
    Location
    Los Angeles
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Yes

    I did use a layer and it worked. But, the page is an asp page and the content changes a little depending on conditions. But I think it will work if I make it big enough. Also, I guess something has to be in the layer or it doesn't work. Like a table cell. Is this the case? This is a good site, I got a lot of help from you folks.
    Thanks
    I will try and return the favor if I can

  11. #11
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this page might be your solution.

    http://www.hut.fi/~ajkoivun/demos/magiclayer_basic.html

    There is a function in here called "hide()"

    It works in Netscape.

    You could do

    <body onLoad="hide()">

    and it would hide the layer with the form in it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •