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"> </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"> </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> </td>
<td> </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> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </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.
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"> </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"> </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> </td>
<td> </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> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </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.