Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    impossibile accedere a window.opener

    ciao a tutti.
    Ho una pagina con un form, la quale apre un pop up con un altro form, al submit della finestra del popup vorre associare oltre al submit dello stesso, anche il submit sul form della finestra madre.
    Il fatto è che l'oggetto window.opener pare non funzionare per niente.
    se ad esempio faccio un alert su window.opener non parte nemmeno l'alert. Solo dalla console degli errori di firefox ottengo "window.opener is undefined".
    questo è il codice del popup:
    codice:
    function display(e,partecipazione) {
        if(!e) e = window.event;
        if (!partecipazione)
          partecipazione="";
        var start=1994;
        var x=e.pageX;
        var y=e.pageY;
        var data = new Date();
        var row=Math.ceil((data.getFullYear()-start+3)/2)
        var count=0;
        var mywindow=window.open("","help","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=240,height="+((row*20)+60)+",screenX="+x+",screenY="+y);
        mywindow.document.write("<HTML><HEAD>");
        mywindow.document.write("<"+'s'+"cript language=\"javascript\">function svuota(oForm) {var frm_elements=oForm.elements;alert(opener.forms[0]);for(i=0; i<frm_elements.length; i++) { frm_elements[i].checked = false;}}</"+'s'+"cript>");
        mywindow.document.write("<TITLE>Partecipazioni</TITLE>");
        mywindow.document.write("</HEAD><BODY BGCOLOR=FF9218 style='overflow-x: hidden;overflow-y: hidden;'>");
        mywindow.document.write("<div style='font-size: small'>Seleziona gli anni in cui hai collaborato con la Cerveza Band.</div>");
        mywindow.document.write("<FORM target='madre' name='anni' method='POST' action='registrazione.php'><table style='font-size: small;margin: 5px 5px 5px 5px'>");
        for(i=start;i<=data.getFullYear();i++){
          if(count==0)
    	mywindow.document.write("<tr>");
          count++;
          mywindow.document.write("<td>"+"<input type='checkbox' name='"+i+"'");
          if(partecipazione.search((i+""))!=-1)
    	mywindow.document.write(" checked='yes' ");
          mywindow.document.write("value='"+i+"'/>"+i+"</td>\n");
          if(count==3){
    	mywindow.document.write("</tr>\n");
    	count=0;
          }
        }
        if(count==0)
          mywindow.document.write("<tr>");
        mywindow.document.write("<td colspan="+(3-count)+"><input type='checkbox' name='sempre' value='sempre'/>sempre</td></tr>");
        mywindow.document.write("</table>");
        mywindow.document.write("<center><input type='submit' value='Aggiorna'><input type='button' value='Svuota' onClick='document.forms[0].reset();svuota(this.form)'><input type='button' value='Chiudi' onClick='window.opener.forms[0].submit();document.forms[0].submit();window.close()'></FORM>");
        mywindow.document.write("</CENTER>");
        mywindow.document.write("</BODY></HTML>");
    Grazie in anticipo

  2. #2
    infatti è window.open che è lasciato da solo, dovresti associarlo ad un javascript.
    Welt

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.