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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show element in parent window from child window

Status
Not open for further replies.

dandrey

Technical User
Apr 28, 2005
41
CO
Hi i have a web page that hides me some objects when is loaded and this part is working fine, but from a child window i'm trying to show the element hidden, but this is not happening.

This is the code from the Father window:
HTML code:

<style type="text/css"> <!-- #layeremp, #layerb{display:none; visibility:hidden} --> </style>
<form action="" method="post" name="formcat" id="formcat">
<table width="418" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="143"><span class="style2">Tipo de clasificado
<input name="valcat" type="hidden" id="valcat" value=" ">
</span></td>
<td width="243" id="cellcat">&nbsp;</td>
<td width="32"><button value="Button" type="button" style="cursor:hand;" onClick="window.open('SearchCat.asp','Category','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=210,height=130');"><img src=" glass.gif"></button></td>
</tr>
<tr>
<td><span class="style2">Subcategoria
<input name="valsubcat" type="hidden" id="valsubcat" value=" ">
</span></td>
<td id="cellsubcat">&nbsp;</td>
<td><button value="Button" type="button" style="cursor:hand;" onClick="window.open('SearchSubCat.asp?valpass='+document.formcat.valcat.value,'Category','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=210,height=130');"><img src=" glass.gif"></button></td>
</tr>
<tr id="layeremp">
<td><span class="style2">Tipo de Cargo </span></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr id="layerb">
<%set rsb=server.CreateObject("adodb.recordset")
sqlb="select * from level3"
set rsb=objConn.execute(sqlb)%>
<td><span class="style2">Tipo de Negocio </span></td>
<td><label>
<select name="cmbbusiness" class="style5" id="cmbbusiness">
<option value="0">:: Seleccione ::</option>
<%while not rsb.eof%>
<option value="<%=rsb("level3id")%>"><%=rsb("level3name")%></option>
<%rsb.movenext
wend%>
</select>
</label></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</form>


This is the code for the child window:

<script language="javascript">
function senddata(){
if(document.form1.adssubcat.value==0){
alert('Por favor seleccione la Categoría.')}
else{window.opener.document.getElementById('cellsubcat').innerHTML=document.form1.adssubcat.options[document.form1.adssubcat.selectedIndex].text;
window.opener.document.formcat.valsubcat.value=document.form1.adssubcat.value;
window.opener.document.formcat.getElementById('layerb').style.display = 'block';
self.close();}
}
</script>



What is wrong?
thanks for your help.
 
Change this:

Code:
<style type="text/css"> <!-- #layeremp, #layerb{display:none; visibility:hidden} --> </style>

to this:

Code:
<style type="text/css">#layeremp, #layerb{display:none;}</style>

You were setting the layer to be hidden using two methods, but only showing it using one, so it still remained hidden.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thank you all.

I tried with this

opener.document.getElementById('layerb').style.display = 'block';

and it works, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top