SPAM-LOW: [Javascript] Window.opener in JSP - again

Peter Brunone peter at brunone.com
Tue Sep 28 15:59:24 CDT 2004


Hello again...

   As far as I know, the select element does not have a value attribute.  You'll have to get the selected value more like this:

var oList = document.sel_municipio.select_mun; 
var selValue = oList.options[oList.selectedIndex].value;

Cheers,

Peter

 From: Guilherme Cordeiro guilhermecordeiro at yahoo.com.br

So, I used the solution provided in those simple html
files. It worked perfectly.

Now, I am trying to use it on some JSP files.

The pop-up window has these elements:

 action="selecionaMunicipio.jsp" method="post">
...

border="0">
...

src="imagens/finalizar.gif" alt="Finalizar"
onclick="javascript:closeMunicipio();"> 

The opener window has these elements:

method="post">
...

cellpadding="1" width="70%" align="center" border="0">
...

gc.codMunNat %>" name=cd_mun_nat>
gc.nomeMunNat %>" name=nm_mun_nat>
value="..." onclick="javascript:openMunicipio();">

The js file:

var novaJanela;

function openMunicipio()
{
novaJanela =
window.open("selecionaMunicipio.jsp",'novaJanela','scrollbars=no,width=500,height=300');
}

function closeMunicipio()
{
self.opener.document.atualizaaluno.nm_mun_nat.value
= self.document.sel_municipio.select_mun.value;
self.close();
self.opener.novaJanela = null;
}
(...)

So, when the user clicks on the "finalizar" image, it
was supposed to update the opener window with the
value selected in the dropdown. I don't know why it's
not working, even if I do like that simple example.
Anyone knows what can I do? Thanks again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040928/d1552e86/attachment.htm>


More information about the Javascript mailing list