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

  • Thread starter Glaanieboy
  • https://www.osnn.net/admin.php?templates/thread_view.1970/delete&_xfRedirect=https%3A%2F%2Fwww.osnn.net%2Fadmin.php%3Ftemplates%2Foutdated Start date

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
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!
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
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 forum posts

Latest profile posts

Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?

Forum statistics

Threads
62,002
Messages
673,449
Members
5,597
Latest member
Mesapplis