Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Position and Visibility

Status
Not open for further replies.

flanakin

Programmer
Mar 21, 2000
158
US
I'm switching between 2 parts of a form, and I don't want the user to do both, so I want to hide the one they aren't using. To do this, I have a radio button. They select one, and the other one is supposed to appear in the first one's place. Well, the problem I'm having, is that whenever I change the POSITION of one, the other will not display. Here's the function I'm using:

// if int
if (c == "int")
{ document.all.step3us.style.position = "absolute";
document.all.step3us.style.visibility = "hidden";
document.all.step3int.style.position = "relative";
document.all.step3int.style.visibility = "visible";
}else
{ document.all.step3int.style.position = "absolute";
document.all.step3int.style.visibility = "hidden";
document.all.step3us.style.position = "relative";
document.all.step3us.style.visibility = "visible";
}

The c variable is passed in as the value of the radio button which will either be "us" or "int".

Is there any way I can get around this problem? I can't seem to figure it out. Oh, and the items are DIVs if that means anything.

Thanks.

Cid
ciddivine@yahoo.com

 
Here's the layout of my form...

Step 1...

Step 2: US or Int?
o US <radio buttons>
o Int <radio buttons>

Step 3: US/Int

Step 4...

<footer>

The problem I'm having is that my US and International are 2 different lengths, and I can resize the sections, but when I do so, it doesn't make the DIV visible again (instead there's a blank space). Now, if I don't change the position from &quot;absolute&quot; to &quot;relative&quot;, it will show it, but it is on top of Step 4 and the footer.

I'm stuck. Oh, and I just viewed it in NN...man, is this ugly. I'm gonna try and see what I can do with that site you sent, thanks.

Cid
ciddivine@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top