• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[javascript] Display a hidden object (see thread for details)

#1
In my search for cute/fun html play thingies I found a fun one here on NTFS.org, or actually vBulletin 3.0. When you want to attach a file to a post, you use the 'Manage Attachments' button, which brings up a new window. When uploading a file in this window, a hidden text becomes unhidden, which says 'Uploading Files, please wait'. I was curious, so I peeked in the source to see how it's being done.
It turns out that a javascript function unhides a hidden text ('display: none' in CSS). I also wanted this, so I copied the relevant bits of code and modified it a bit and put it in a file.
As you may guess, it doesn't work. I put in alert boxes in each if...else structure, but it doesn't even display that. Can anyone point me out what is broken and should be fixed? The file can be found at http://glaanieboy.dyndns.org/test_pages/index.html

Thanks!
 
#2
When you are looking for an answer you can't find it, but when you aren't, you bump into it right away :rolleyes: :lol:
I found a better javascript function on another website and that code works :)

Code:
function hideTable(ID) {
        if (document.getElementById(ID).style.display == "") {
            document.getElementById(ID).style.display = "none";
        } else {
            document.getElementById(ID).style.display = "";
        }
}
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,962
Messages
673,240
Members
89,015
Latest member
loxioalix