View Full Version : Show a DIV and hide a DIV...

06-26-2009, 09:57 PM

I've been trying to do this for the past hour or so, and still haven't solved it, what I'm trying to do is unhide one div and then when it's unhidden hide a div that's above the hidden div that has just been unhidden.

What it is, I got a control panel I'm working on and it shows the user say their current e-mail address, before the edit form is shown (when clicked it's unhidden).

I got this script to do the simple function of unhiding the edit form but when it unhides it, it does hide it but it hides it on the called function. Say a user clicked on "Edit Email" it would hide the div total oppersit to that one say it would hide the one that tells them their "name" that's on file.

Grrr so frustrating lol, hope someone can help me solve this :)

Here's the JS:

<script type="text/javascript">
function showHide(elementid){
if (document.getElementById(elementid).style.display == ''){
document.getElementById("user_info").style.display = "none";
if (document.getElementById(elementid).style.display == 'none'){
document.getElementById(elementid).style.display = '';
} else {
document.getElementById(elementid).style.display = 'none';
document.getElementById("user_info").style.display = "";

Hyde360 :cool: