Can't get child_window.close() function to work...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marcelf3@yahoo.com

    #1

    Can't get child_window.close() function to work...

    Hello..
    This page opens a window with some information, but everytime the user
    changes a field in the parent window, the child window needs to be
    closed.
    These 2 functions were supposed to do the work.

    Nota() - opens new window.
    fechaNota() - closes the window opened by Nota()

    here is the code.
    thanks in advance.


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
    <html>
    <head>
    <meta http-equiv="Content-Language" content="pt-br">
    <LINK href="http://marcel/default.css" type="text/css"
    rel="stylesheet ">
    <title>Serviç os Online</title>
    <script Language="javas cript" src="http://marcel//funcoes.js"></script>
    <script language="JavaS cript1.2">
    function DisableAll() {
    document.form1. cliNome.disable d = true;
    document.form1. cliCGC.disabled = true;
    document.form1. cliEnd.disabled = true;
    document.form1. cliBairro.disab led = true;
    document.form1. cliMun.disabled = true;
    document.form1. cliUF.disabled = true;
    document.form1. cliCEP.disabled = true;

    document.form1. c1_i1.disabled = true;
    document.form1. c2_i1.disabled = true;
    document.form1. c3_i1.disabled = true;

    document.form1. c1_i2.disabled = true;
    document.form1. c2_i2.disabled = true;
    document.form1. c3_i2.disabled = true;

    document.form1. c1_i3.disabled = true;
    document.form1. c2_i3.disabled = true;
    document.form1. c3_i3.disabled = true;

    document.form1. c1_i4.disabled = true;
    document.form1. c2_i4.disabled = true;
    document.form1. c3_i4.disabled = true;

    document.form1. c1_i5.disabled = true;
    document.form1. c2_i5.disabled = true;
    document.form1. c3_i5.disabled = true;

    document.form1. c1_i6.disabled = true;
    document.form1. c2_i6.disabled = true;
    document.form1. c3_i6.disabled = true;

    document.form1. c1_i7.disabled = true;
    document.form1. c2_i7.disabled = true;
    document.form1. c3_i7.disabled = true;

    document.form1. c1_i8.disabled = true;
    document.form1. c2_i8.disabled = true;
    document.form1. c3_i8.disabled = true;

    document.form1. c1_i9.disabled = true;
    document.form1. c2_i9.disabled = true;
    document.form1. c3_i9.disabled = true;

    document.form1. c1_i10.disabled = true;
    document.form1. c2_i10.disabled = true;
    document.form1. c3_i10.disabled = true;

    document.form1. c1_i11.disabled = true;
    document.form1. c2_i11.disabled = true;
    document.form1. c3_i11.disabled = true;

    document.form1. c1_i12.disabled = true;
    document.form1. c2_i12.disabled = true;
    document.form1. c3_i12.disabled = true;

    document.form1. c1_i13.disabled = true;
    document.form1. c2_i13.disabled = true;
    document.form1. c3_i13.disabled = true;

    document.form1. c1_i14.disabled = true;
    document.form1. c2_i14.disabled = true;
    document.form1. c3_i14.disabled = true;

    document.form1. c1_i15.disabled = true;
    document.form1. c2_i15.disabled = true;
    document.form1. c3_i15.disabled = true;

    document.form1. Observ.disabled = true;
    }

    function EnableAll() {
    document.form1. cliNome.disable d = false;
    document.form1. cliCGC.disabled = false;
    document.form1. cliEnd.disabled = false;
    document.form1. cliBairro.disab led = false;
    document.form1. cliMun.disabled = false;
    document.form1. cliUF.disabled = false;
    document.form1. cliCEP.disabled = false;

    document.form1. c1_i1.disabled = false;
    document.form1. c2_i1.disabled = false;
    document.form1. c3_i1.disabled = false;

    document.form1. c1_i2.disabled = false;
    document.form1. c2_i2.disabled = false;
    document.form1. c3_i2.disabled = false;

    document.form1. c1_i3.disabled = false;
    document.form1. c2_i3.disabled = false;
    document.form1. c3_i3.disabled = false;

    document.form1. c1_i4.disabled = false;
    document.form1. c2_i4.disabled = false;
    document.form1. c3_i4.disabled = false;

    document.form1. c1_i5.disabled = false;
    document.form1. c2_i5.disabled = false;
    document.form1. c3_i5.disabled = false;

    document.form1. c1_i6.disabled = false;
    document.form1. c2_i6.disabled = false;
    document.form1. c3_i6.disabled = false;

    document.form1. c1_i7.disabled = false;
    document.form1. c2_i7.disabled = false;
    document.form1. c3_i7.disabled = false;

    document.form1. c1_i8.disabled = false;
    document.form1. c2_i8.disabled = false;
    document.form1. c3_i8.disabled = false;

    document.form1. c1_i9.disabled = false;
    document.form1. c2_i9.disabled = false;
    document.form1. c3_i9.disabled = false;

    document.form1. c1_i10.disabled = false;
    document.form1. c2_i10.disabled = false;
    document.form1. c3_i10.disabled = false;

    document.form1. c1_i11.disabled = false;
    document.form1. c2_i11.disabled = false;
    document.form1. c3_i11.disabled = false;

    document.form1. c1_i12.disabled = false;
    document.form1. c2_i12.disabled = false;
    document.form1. c3_i12.disabled = false;

    document.form1. c1_i13.disabled = false;
    document.form1. c2_i13.disabled = false;
    document.form1. c3_i13.disabled = false;

    document.form1. c1_i14.disabled = false;
    document.form1. c2_i14.disabled = false;
    document.form1. c3_i14.disabled = false;

    document.form1. c1_i15.disabled = false;
    document.form1. c2_i15.disabled = false;
    document.form1. c3_i15.disabled = false;

    document.form1. Observ.disabled = false;
    }

    function EnviaDados() {
    EnableAll();
    document.form1. submit();
    if ( document.validN ota.Imprimiu.va lue == 'X' ) {
    DisableAll();
    }
    }

    function LimparForm() {
    if(document.val idNota.Imprimiu .value == 'X') {
    if(confirm('A impressão da nota anterior foi bem sucedida? Se houve
    problemas aperte "Cancelar" e imprima novamente até obter êxito.')) {
    document.validN ota.submit();
    }
    } else {
    document.form1. reset();
    }
    }

    function Nota()
    {
    if( (trim(document. form1.cliNome.v alue) == '') ||
    (

    (trim(document. form1.c3_i1.val ue == '')) &&

    (trim(document. form1.c3_i2.val ue == '')) &&

    (trim(document. form1.c3_i3.val ue == '')) &&

    (trim(document. form1.c3_i4.val ue == '')) &&

    (trim(document. form1.c3_i5.val ue == '')) &&

    (trim(document. form1.c3_i6.val ue == '')) &&

    (trim(document. form1.c3_i7.val ue == '')) &&

    (trim(document. form1.c3_i8.val ue == '')) &&

    (trim(document. form1.c3_i9.val ue == '')) &&

    (trim(document. form1.c3_i10.va lue == '')) &&

    (trim(document. form1.c3_i11.va lue == '')) &&

    (trim(document. form1.c3_i12.va lue == '')) &&

    (trim(document. form1.c3_i13.va lue == '')) &&

    (trim(document. form1.c3_i14.va lue == '')) &&

    (trim(document. form1.c3_i15.va lue == '')) ) ||
    (

    (trim(document. form1.c1_i1.val ue == '')) &&

    (trim(document. form1.c1_i2.val ue == '')) &&

    (trim(document. form1.c1_i3.val ue == '')) &&

    (trim(document. form1.c1_i4.val ue == '')) &&

    (trim(document. form1.c1_i5.val ue == '')) &&

    (trim(document. form1.c1_i6.val ue == '')) &&

    (trim(document. form1.c1_i7.val ue == '')) &&

    (trim(document. form1.c1_i8.val ue == '')) &&

    (trim(document. form1.c1_i9.val ue == '')) &&

    (trim(document. form1.c1_i10.va lue == '')) &&

    (trim(document. form1.c1_i11.va lue == '')) &&

    (trim(document. form1.c1_i12.va lue == '')) &&

    (trim(document. form1.c1_i13.va lue == '')) &&

    (trim(document. form1.c1_i14.va lue == '')) &&

    (trim(document. form1.c3_i15.va lue == '')) )
    ){
    alert('Os preenchimento correto dos campos: "Nome do Cliente" /
    "Descrição do Serviço" / "Valor do Serviço" são obrigatórios.
    Favor conferir. ');
    return false;
    }else{
    notaFiscal =
    window.open('', 'Nota','scrollb ars=yes,menubar =no,height=600, width=720,resiz able=yes,toolba r=no,location=n o,status=no');
    return true;
    }
    }

    function fechaNota() {
    //if( notaFiscal.clos ed != true ) {
    notaFiscal.clos e();
    //}
    }
    </script>
    </head>

    <body>

    <table class=mae>

    <tr>
    <td bgcolor="#F8F8F 8">
    <font size="4"><b>
    <img src="http://marcel/Imagens/logo.jpg" width="49"
    height="52">Pre feitura Xxxxxx Xxxxxx </b></font></td>
    </tr>

    <tr>
    <td bgcolor="#0000C C">
    <font color="#FFFFFF" size="3">
    <b>Emissão Online de Notas Fiscais</b></font></td>
    </tr>

    <tr>
    <td>
    <br>
    <form name="form1" method="POST" action="u_gspw0 12.apw"
    onsubmit="retur n Nota();" target="Nota">
    <table border="1">
    <tr id=linha>
    <td width="14%" nowrap> <img src="http://marcel/Imagens/empresa.jpg"
    width="70" height="70">
    <br>
    <input type="button" name="AltLogo" value="Alterar Logo"
    class="Combo"
    onclick="javasc ript:upLogoEmp( );window.locati on='u_gspw013.a pw'"
    target="upLogo" >
    </td>
    <td width="86%" nowrap>
    <b><font size="4">COMERC IO SOM DO MUNDO /SP </font></b>
    <br>
    R VOLUNTARIOS DA PATRIA, 1234&nbsp;&nbsp ; CEP 02031000 <br>
    SANTANA&nbsp;&n bsp; SAO PAULO - SP <br>
    Fone: (011)36954259 &nbsp;&nbsp; CNPJ: 00. . / - <br>
    Inscrição Municipal: 23.233.124-2.3
    </td>
    </tr>
    <tr id=linha>
    <td colspan="2">
    <b>Destinatário :</b> <br>
    <a href="javascrip t:fechaNota()"> FUNCIONA</a>
    Nome: <input name="cliNome" type="text" size="45" class="Campo"
    id="especial" onFocus="javasc ript:fechaNota( )">
    CPF/CNPJ: <input name="cliCGC" type="text" size="20" class="Campo"
    id="especial" onFocus="javasc ript:fechaNota( )">
    <br>
    Endereço: <input name="cliEnd" type="text" size="47" class="Campo"
    id="especial" onFocus="javasc ript:fechaNota( )">
    Bairro: <input name="cliBairro " type="text" size="25" class="Campo"
    id="especial" onFocus="javasc ript:fechaNota( )">
    <br>
    Munic&iacute;pi o: <input name="cliMun" type="text" size="25"
    class="Campo" id="especial" onFocus="javasc ript:fechaNota( )">
    UF: <input name="cliUF" type="text" size="5" class="Campo"
    id="especial" maxlength="8" onFocus="javasc ript:fechaNota( )">
    CEP: <input name="cliCEP" type="text" size="25" class="Campo"
    id="especial" onFocus="javasc ript:fechaNota( )">
    </td>
    </tr>
    <tr id=linha>
    <td colspan="2">

    <table border="1" cellpadding="0" cellspacing="2" bordercolor="bl ack">
    <TR id=cabec>
    <TD >
    Descrição dos Serviços
    </TD>
    <TD >
    Quantidade
    </TD>
    <TD >
    Valor
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i1" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i1" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i1" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 )"
    onblur="dinheir o(window.docume nt.form1.c3_i1) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i2" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i2" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i2" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i2 )"
    onblur="dinheir o(window.docume nt.form1.c3_i2) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i3" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i3" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i3" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i3 )"
    onblur="dinheir o(window.docume nt.form1.c3_i3) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i4" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i4" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i4" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i4 )"
    onblur="dinheir o(window.docume nt.form1.c3_i4) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i5" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i5" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i5" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i5 )"
    onblur="dinheir o(window.docume nt.form1.c3_i5) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i6" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i6" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i6" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i6 )"
    onblur="dinheir o(window.docume nt.form1.c3_i6) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i7" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i7" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i7" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i7 )"
    onblur="dinheir o(window.docume nt.form1.c3_i7) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i8" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i8" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i8" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i8 )"
    onblur="dinheir o(window.docume nt.form1.c3_i8) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i9" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i9" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i9" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i9 )"
    onblur="dinheir o(window.docume nt.form1.c3_i9) ">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i10" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i10" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i10" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 0)"
    onblur="dinheir o(window.docume nt.form1.c3_i10 )">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i11" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i11" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i11" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 1)"
    onblur="dinheir o(window.docume nt.form1.c3_i11 )">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i12" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i12" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i12" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 2)"
    onblur="dinheir o(window.docume nt.form1.c3_i12 )">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i13" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i13" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i13" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 3)"
    onblur="dinheir o(window.docume nt.form1.c3_i13 )">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i14" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i14" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i14" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 4)"
    onblur="dinheir o(window.docume nt.form1.c3_i14 )">
    </TD>
    </TR>
    <TR id=linha>
    <TD >
    <input name="c1_i15" type="text" size="72" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial">
    </TD>
    <TD >
    <input name="c2_i15" type="text" size="12" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeypress="ret urn soNumero();">
    </TD>
    <TD >
    <input name="c3_i15" type="text" size="27" class="Campo"
    onFocus="javasc ript:notaFiscal .close();" id="especial"
    onkeyup="dinhei ro(window.docum ent.form1.c3_i1 5)"
    onblur="dinheir o(window.docume nt.form1.c3_i15 )">
    </TD>
    </TR>
    </table>

    </td>
    </tr>
    <tr id=linha>
    <td valign=top colspan="2">
    <strong>Observa &ccedil;&otilde ;es:</strong>
    <textarea name="Observ" cols="100" rows="3" wrap="VIRTUAL"
    class="Campo" id="especial"
    onFocus="javasc ript:fechaNota( )"></textarea>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <div align="center">
    <input class="Combo" type="button" name="EmitirNot a"
    value="Emitir Nota" onclick="EnviaD ados()">&nbsp;& nbsp;
    <input class="Combo" type="button" name="Limpar"
    value="Limpar formul&aacute;r io" onclick="Limpar Form()">
    <input class="Combo" type="button" name="Sair" value="Encerrar "
    onclick="window .location='http ://marcel/u_gspwlogoff.ap w'">
    </div>
    </td>
    </tr>
    </table>
    </form>
    <br><br>
    </td>
    </tr>

    <tr>
    <td bgcolor="#EBEBE B" height=4>
    </td>
    </tr>

    <tr>
    <td bgcolor="#0000C C" height=4>
    </td>
    </tr>
    </table>

    <form name="validCanc el" action="u_gspw0 16.apw" method="post">
    <input type="hidden" value="X" name="notaOK">
    </form>
    <form name="validNota " action="u_gspw0 18.apw" method="post">
    <input type="hidden" value=" " name="Imprimiu" >
    </form>
    </body>

    </html>

  • Robert

    #2
    Re: Can't get child_window.cl ose() function to work...

    In article <1105117383.663 023.76610@f14g2 000cwb.googlegr oups.com>,
    marcelf3@yahoo. com wrote:
    [color=blue]
    > Hello..
    > This page opens a window with some information, but everytime the user
    > changes a field in the parent window, the child window needs to be
    > closed.[/color]

    Do two windows appear when I open the page? ( Have you heard about pop
    blockers?) Do I have to click on something to get the second page.

    [color=blue]
    > These 2 functions were supposed to do the work.
    >
    > Nota() - opens new window.
    > fechaNota() - closes the window opened by Nota()
    >
    > here is the code.[/color]

    It would be best to trim the code down to only include the problem two
    subroutines.

    I tried displaying this html file, but IE found some errors. I could
    not figure on how to get the second window to appear.
    [color=blue]
    > thanks in advance.
    >
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
    > <html>
    > <head>
    > <meta http-equiv="Content-Language" content="pt-br">
    > <LINK href="http://marcel/default.css" type="text/css"[/color]

    IE found an error with this. You need a valid internet address. This is
    a local address.
    [color=blue]
    > rel="stylesheet ">
    > <title>Serviç os Online</title>
    > <script Language="javas cript" src="http://marcel//funcoes.js"></script>[/color]

    IE didn't like this web address either.
    [color=blue]
    > <script language="JavaS cript1.2">[/color]

    The language attribute has been depreciated. Javascript1.2 is
    nonstandard implementation of today's Javascript. I suggest you use:
    <script type="text/javascript">

    Robert

    Comment

    • marcelf3@yahoo.com

      #3
      Re: Can't get child_window.cl ose() function to work...

      Hi Robert.
      Thanks for taking the time to look at my code.
      I know IE would find some errors, but it wont be a problem to debug my
      javascript problem.

      There is a button called "Emitir Nota" which simply submits the form1.
      When it submits, there is a onSubmit = "Nota()".
      So a new window is opened when the user clicks on that button.

      The IE will also point some javascript errors. They are created because
      all fields are set with the onfocus = "javascript:fec harNota()".
      So, anytime you focus a field, it triggers the function to try to close
      the child window opened by "Nota()".

      Robert wrote:[color=blue]
      > In article <1105117383.663 023.76610@f14g2 000cwb.googlegr oups.com>,
      > marcelf3@yahoo. com wrote:
      >[color=green]
      > > Hello..
      > > This page opens a window with some information, but everytime the[/color][/color]
      user[color=blue][color=green]
      > > changes a field in the parent window, the child window needs to be
      > > closed.[/color]
      >
      > Do two windows appear when I open the page? ( Have you heard about[/color]
      pop[color=blue]
      > blockers?) Do I have to click on something to get the second page.
      >
      >[color=green]
      > > These 2 functions were supposed to do the work.
      > >
      > > Nota() - opens new window.
      > > fechaNota() - closes the window opened by Nota()
      > >
      > > here is the code.[/color]
      >
      > It would be best to trim the code down to only include the problem[/color]
      two[color=blue]
      > subroutines.
      >
      > I tried displaying this html file, but IE found some errors. I could[/color]
      [color=blue]
      > not figure on how to get the second window to appear.
      >[color=green]
      > > thanks in advance.
      > >
      > >
      > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
      > > <html>
      > > <head>
      > > <meta http-equiv="Content-Language" content="pt-br">
      > > <LINK href="http://marcel/default.css" type="text/css"[/color]
      >
      > IE found an error with this. You need a valid internet address. This[/color]
      is[color=blue]
      > a local address.
      >[color=green]
      > > rel="stylesheet ">
      > > <title>Serviç os Online</title>
      > > <script Language="javas cript"[/color][/color]
      src="http://marcel//funcoes.js"></script>[color=blue]
      >
      > IE didn't like this web address either.
      >[color=green]
      > > <script language="JavaS cript1.2">[/color]
      >
      > The language attribute has been depreciated. Javascript1.2 is
      > nonstandard implementation of today's Javascript. I suggest you use:
      > <script type="text/javascript">
      >
      > Robert[/color]

      Comment

      • marcelf3@yahoo.com

        #4
        Re: Can't get child_window.cl ose() function to work...

        Another thing. The window is opened with no errors by the "Nota()".
        The only problem is the "fechaNota( )". The IE says that "notaFiscal "
        (child window that had been opened) is undefined.

        Comment

        • Robert

          #5
          Re: Can't get child_window.cl ose() function to work...


          marcelf3@yahoo. com wrote:[color=blue]
          > Another thing. The window is opened with no errors by the "Nota()".
          > The only problem is the "fechaNota( )". The IE says that "notaFiscal "
          > (child window that had been opened) is undefined.[/color]

          <form name="form1" method="POST" action="u gspw012.apw"
          onsubmit="retur n Nota();" target="Nota">

          What I believe you are doing is putting up a window then returning
          true. Returning true will post your form to the server. What you now
          have is two windows on the screen. The orginal window gets the results
          from the server.

          I assume the user does a back to get to the form. The form has now
          been reloaded and the variable notaFiscal has been lost.

          Instead of putting up the second window, have the server write the
          results in the original window.

          You may want to try out amazon.com to see how they handle a sale.

          In the future, you will get faster results from your questions by
          following this advice:


          Robert

          Comment

          • Robert

            #6
            Re: Can't get child_window.cl ose() function to work...

            You can get the window handle by doing another open. If you supply the
            same title and the window is opened, you will get back the handle. You
            can now close the window. Of course, if the winow isn't opened, you
            get a new windows displayed. You could close the window, but it might
            flash on the screen.

            Robert

            Comment

            • marcelf3@yahoo.com

              #7
              Re: Can't get child_window.cl ose() function to work...

              i got it working.
              the whole problem was because that "return ..." in the onsubmit.
              somewhat
              the variable was getting lost because of that.
              thank you robert for all the help.

              Robert wrote:[color=blue]
              > You can get the window handle by doing another open. If you supply[/color]
              the[color=blue]
              > same title and the window is opened, you will get back the handle.[/color]
              You[color=blue]
              > can now close the window. Of course, if the winow isn't opened, you
              > get a new windows displayed. You could close the window, but it[/color]
              might[color=blue]
              > flash on the screen.
              >
              > Robert[/color]

              Comment

              Working...