Click to See Complete Forum and Search --> : Show/Hide Links on other forms


TimSBurke
07-21-2003, 08:23 AM
I'm trying to figure out how to hide or show a link on a main form based on the user's action on a popup form.

For example, the user clicks on a link from Form A that pops up Form B. Based on the user's action (clicking an UPDATE button), I need to be able to hide the link the user orignally clicked on Form A.

Can anyone help???

Thanks,
Tim Burke

Khalid Ali
07-21-2003, 09:12 AM
set id attributes for links in the main frame page.then access this id using document.getElementById('"....") and set this objects visibility = "hidden"

suppose you have link in the main frame.

<a id="link_1" href="http://www.w3c.org">W3C</a>

now in the onclick event of the button in the popup page put the following

onclick="top.opener.documment.getElementById('link_1').style.visibility="hidden"
instead of visibility CSS property you can use dsiplay = none depending upon the structure of your page.

TimSBurke
07-21-2003, 09:42 AM
Thanks Khalid!

It worked like a charm!

:D

Khalid Ali
07-21-2003, 09:47 AM
you are welcome
:D