M
marcelf3
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="javascript" src="http://marcel//funcoes.js"></script>
<script language="JavaScript1.2">
function DisableAll() {
document.form1.cliNome.disabled = true;
document.form1.cliCGC.disabled = true;
document.form1.cliEnd.disabled = true;
document.form1.cliBairro.disabled = 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.disabled = false;
document.form1.cliCGC.disabled = false;
document.form1.cliEnd.disabled = false;
document.form1.cliBairro.disabled = 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.validNota.Imprimiu.value == 'X' ) {
DisableAll();
}
}
function LimparForm() {
if(document.validNota.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.validNota.submit();
}
} else {
document.form1.reset();
}
}
function Nota()
{
if( (trim(document.form1.cliNome.value) == '') ||
(
(trim(document.form1.c3_i1.value == '')) &&
(trim(document.form1.c3_i2.value == '')) &&
(trim(document.form1.c3_i3.value == '')) &&
(trim(document.form1.c3_i4.value == '')) &&
(trim(document.form1.c3_i5.value == '')) &&
(trim(document.form1.c3_i6.value == '')) &&
(trim(document.form1.c3_i7.value == '')) &&
(trim(document.form1.c3_i8.value == '')) &&
(trim(document.form1.c3_i9.value == '')) &&
(trim(document.form1.c3_i10.value == '')) &&
(trim(document.form1.c3_i11.value == '')) &&
(trim(document.form1.c3_i12.value == '')) &&
(trim(document.form1.c3_i13.value == '')) &&
(trim(document.form1.c3_i14.value == '')) &&
(trim(document.form1.c3_i15.value == '')) ) ||
(
(trim(document.form1.c1_i1.value == '')) &&
(trim(document.form1.c1_i2.value == '')) &&
(trim(document.form1.c1_i3.value == '')) &&
(trim(document.form1.c1_i4.value == '')) &&
(trim(document.form1.c1_i5.value == '')) &&
(trim(document.form1.c1_i6.value == '')) &&
(trim(document.form1.c1_i7.value == '')) &&
(trim(document.form1.c1_i8.value == '')) &&
(trim(document.form1.c1_i9.value == '')) &&
(trim(document.form1.c1_i10.value == '')) &&
(trim(document.form1.c1_i11.value == '')) &&
(trim(document.form1.c1_i12.value == '')) &&
(trim(document.form1.c1_i13.value == '')) &&
(trim(document.form1.c1_i14.value == '')) &&
(trim(document.form1.c3_i15.value == '')) )
){
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','scrollbars=yes,menubar=no,height=600,width=720,resizable=yes,toolbar=no,location=no,status=no');
return true;
}
}
function fechaNota() {
//if( notaFiscal.closed != true ) {
notaFiscal.close();
//}
}
</script>
</head>
<body>
<table class=mae>
<tr>
<td bgcolor="#F8F8F8">
<font size="4"><b>
<img src="http://marcel/Imagens/logo.jpg" width="49"
height="52">Prefeitura Xxxxxx Xxxxxx </b></font></td>
</tr>
<tr>
<td bgcolor="#0000CC">
<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_gspw012.apw"
onsubmit="return 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="javascript:upLogoEmp();window.location='u_gspw013.apw'"
target="upLogo">
</td>
<td width="86%" nowrap>
<b><font size="4">COMERCIO SOM DO MUNDO /SP </font></b>
<br>
R VOLUNTARIOS DA PATRIA, 1234 CEP 02031000 <br>
SANTANA SAO PAULO - SP <br>
Fone: (011)36954259 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="javascript:fechaNota()">FUNCIONA</a>
Nome: <input name="cliNome" type="text" size="45" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
CPF/CNPJ: <input name="cliCGC" type="text" size="20" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
<br>
Endereço: <input name="cliEnd" type="text" size="47" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
Bairro: <input name="cliBairro" type="text" size="25" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
<br>
Município: <input name="cliMun" type="text" size="25"
class="Campo" id="especial" onFocus="javascript:fechaNota()">
UF: <input name="cliUF" type="text" size="5" class="Campo"
id="especial" maxlength="8" onFocus="javascript:fechaNota()">
CEP: <input name="cliCEP" type="text" size="25" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
</td>
</tr>
<tr id=linha>
<td colspan="2">
<table border="1" cellpadding="0" cellspacing="2" bordercolor="black">
<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="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i1" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i1" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i1)"
onblur="dinheiro(window.document.form1.c3_i1)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i2" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i2" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i2" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i2)"
onblur="dinheiro(window.document.form1.c3_i2)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i3" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i3" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i3" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i3)"
onblur="dinheiro(window.document.form1.c3_i3)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i4" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i4" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i4" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i4)"
onblur="dinheiro(window.document.form1.c3_i4)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i5" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i5" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i5" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i5)"
onblur="dinheiro(window.document.form1.c3_i5)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i6" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i6" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i6" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i6)"
onblur="dinheiro(window.document.form1.c3_i6)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i7" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i7" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i7" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i7)"
onblur="dinheiro(window.document.form1.c3_i7)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i8" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i8" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i8" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i8)"
onblur="dinheiro(window.document.form1.c3_i8)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i9" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i9" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i9" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i9)"
onblur="dinheiro(window.document.form1.c3_i9)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i10" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i10" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i10" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i10)"
onblur="dinheiro(window.document.form1.c3_i10)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i11" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i11" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i11" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i11)"
onblur="dinheiro(window.document.form1.c3_i11)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i12" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i12" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i12" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i12)"
onblur="dinheiro(window.document.form1.c3_i12)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i13" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i13" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i13" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i13)"
onblur="dinheiro(window.document.form1.c3_i13)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i14" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i14" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i14" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i14)"
onblur="dinheiro(window.document.form1.c3_i14)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i15" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i15" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i15" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i15)"
onblur="dinheiro(window.document.form1.c3_i15)">
</TD>
</TR>
</table>
</td>
</tr>
<tr id=linha>
<td valign=top colspan="2">
<strong>Observações:</strong>
<textarea name="Observ" cols="100" rows="3" wrap="VIRTUAL"
class="Campo" id="especial"
onFocus="javascript:fechaNota()"></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input class="Combo" type="button" name="EmitirNota"
value="Emitir Nota" onclick="EnviaDados()">
<input class="Combo" type="button" name="Limpar"
value="Limpar formulário" onclick="LimparForm()">
<input class="Combo" type="button" name="Sair" value="Encerrar"
onclick="window.location='http://marcel/u_gspwlogoff.apw'">
</div>
</td>
</tr>
</table>
</form>
<br><br>
</td>
</tr>
<tr>
<td bgcolor="#EBEBEB" height=4>
</td>
</tr>
<tr>
<td bgcolor="#0000CC" height=4>
</td>
</tr>
</table>
<form name="validCancel" action="u_gspw016.apw" method="post">
<input type="hidden" value="X" name="notaOK">
</form>
<form name="validNota" action="u_gspw018.apw" method="post">
<input type="hidden" value=" " name="Imprimiu">
</form>
</body>
</html>
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="javascript" src="http://marcel//funcoes.js"></script>
<script language="JavaScript1.2">
function DisableAll() {
document.form1.cliNome.disabled = true;
document.form1.cliCGC.disabled = true;
document.form1.cliEnd.disabled = true;
document.form1.cliBairro.disabled = 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.disabled = false;
document.form1.cliCGC.disabled = false;
document.form1.cliEnd.disabled = false;
document.form1.cliBairro.disabled = 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.validNota.Imprimiu.value == 'X' ) {
DisableAll();
}
}
function LimparForm() {
if(document.validNota.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.validNota.submit();
}
} else {
document.form1.reset();
}
}
function Nota()
{
if( (trim(document.form1.cliNome.value) == '') ||
(
(trim(document.form1.c3_i1.value == '')) &&
(trim(document.form1.c3_i2.value == '')) &&
(trim(document.form1.c3_i3.value == '')) &&
(trim(document.form1.c3_i4.value == '')) &&
(trim(document.form1.c3_i5.value == '')) &&
(trim(document.form1.c3_i6.value == '')) &&
(trim(document.form1.c3_i7.value == '')) &&
(trim(document.form1.c3_i8.value == '')) &&
(trim(document.form1.c3_i9.value == '')) &&
(trim(document.form1.c3_i10.value == '')) &&
(trim(document.form1.c3_i11.value == '')) &&
(trim(document.form1.c3_i12.value == '')) &&
(trim(document.form1.c3_i13.value == '')) &&
(trim(document.form1.c3_i14.value == '')) &&
(trim(document.form1.c3_i15.value == '')) ) ||
(
(trim(document.form1.c1_i1.value == '')) &&
(trim(document.form1.c1_i2.value == '')) &&
(trim(document.form1.c1_i3.value == '')) &&
(trim(document.form1.c1_i4.value == '')) &&
(trim(document.form1.c1_i5.value == '')) &&
(trim(document.form1.c1_i6.value == '')) &&
(trim(document.form1.c1_i7.value == '')) &&
(trim(document.form1.c1_i8.value == '')) &&
(trim(document.form1.c1_i9.value == '')) &&
(trim(document.form1.c1_i10.value == '')) &&
(trim(document.form1.c1_i11.value == '')) &&
(trim(document.form1.c1_i12.value == '')) &&
(trim(document.form1.c1_i13.value == '')) &&
(trim(document.form1.c1_i14.value == '')) &&
(trim(document.form1.c3_i15.value == '')) )
){
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','scrollbars=yes,menubar=no,height=600,width=720,resizable=yes,toolbar=no,location=no,status=no');
return true;
}
}
function fechaNota() {
//if( notaFiscal.closed != true ) {
notaFiscal.close();
//}
}
</script>
</head>
<body>
<table class=mae>
<tr>
<td bgcolor="#F8F8F8">
<font size="4"><b>
<img src="http://marcel/Imagens/logo.jpg" width="49"
height="52">Prefeitura Xxxxxx Xxxxxx </b></font></td>
</tr>
<tr>
<td bgcolor="#0000CC">
<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_gspw012.apw"
onsubmit="return 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="javascript:upLogoEmp();window.location='u_gspw013.apw'"
target="upLogo">
</td>
<td width="86%" nowrap>
<b><font size="4">COMERCIO SOM DO MUNDO /SP </font></b>
<br>
R VOLUNTARIOS DA PATRIA, 1234 CEP 02031000 <br>
SANTANA SAO PAULO - SP <br>
Fone: (011)36954259 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="javascript:fechaNota()">FUNCIONA</a>
Nome: <input name="cliNome" type="text" size="45" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
CPF/CNPJ: <input name="cliCGC" type="text" size="20" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
<br>
Endereço: <input name="cliEnd" type="text" size="47" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
Bairro: <input name="cliBairro" type="text" size="25" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
<br>
Município: <input name="cliMun" type="text" size="25"
class="Campo" id="especial" onFocus="javascript:fechaNota()">
UF: <input name="cliUF" type="text" size="5" class="Campo"
id="especial" maxlength="8" onFocus="javascript:fechaNota()">
CEP: <input name="cliCEP" type="text" size="25" class="Campo"
id="especial" onFocus="javascript:fechaNota()">
</td>
</tr>
<tr id=linha>
<td colspan="2">
<table border="1" cellpadding="0" cellspacing="2" bordercolor="black">
<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="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i1" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i1" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i1)"
onblur="dinheiro(window.document.form1.c3_i1)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i2" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i2" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i2" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i2)"
onblur="dinheiro(window.document.form1.c3_i2)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i3" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i3" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i3" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i3)"
onblur="dinheiro(window.document.form1.c3_i3)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i4" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i4" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i4" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i4)"
onblur="dinheiro(window.document.form1.c3_i4)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i5" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i5" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i5" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i5)"
onblur="dinheiro(window.document.form1.c3_i5)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i6" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i6" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i6" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i6)"
onblur="dinheiro(window.document.form1.c3_i6)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i7" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i7" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i7" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i7)"
onblur="dinheiro(window.document.form1.c3_i7)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i8" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i8" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i8" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i8)"
onblur="dinheiro(window.document.form1.c3_i8)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i9" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i9" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i9" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i9)"
onblur="dinheiro(window.document.form1.c3_i9)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i10" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i10" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i10" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i10)"
onblur="dinheiro(window.document.form1.c3_i10)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i11" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i11" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i11" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i11)"
onblur="dinheiro(window.document.form1.c3_i11)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i12" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i12" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i12" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i12)"
onblur="dinheiro(window.document.form1.c3_i12)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i13" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i13" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i13" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i13)"
onblur="dinheiro(window.document.form1.c3_i13)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i14" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i14" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i14" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i14)"
onblur="dinheiro(window.document.form1.c3_i14)">
</TD>
</TR>
<TR id=linha>
<TD >
<input name="c1_i15" type="text" size="72" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial">
</TD>
<TD >
<input name="c2_i15" type="text" size="12" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeypress="return soNumero();">
</TD>
<TD >
<input name="c3_i15" type="text" size="27" class="Campo"
onFocus="javascript:notaFiscal.close();" id="especial"
onkeyup="dinheiro(window.document.form1.c3_i15)"
onblur="dinheiro(window.document.form1.c3_i15)">
</TD>
</TR>
</table>
</td>
</tr>
<tr id=linha>
<td valign=top colspan="2">
<strong>Observações:</strong>
<textarea name="Observ" cols="100" rows="3" wrap="VIRTUAL"
class="Campo" id="especial"
onFocus="javascript:fechaNota()"></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input class="Combo" type="button" name="EmitirNota"
value="Emitir Nota" onclick="EnviaDados()">
<input class="Combo" type="button" name="Limpar"
value="Limpar formulário" onclick="LimparForm()">
<input class="Combo" type="button" name="Sair" value="Encerrar"
onclick="window.location='http://marcel/u_gspwlogoff.apw'">
</div>
</td>
</tr>
</table>
</form>
<br><br>
</td>
</tr>
<tr>
<td bgcolor="#EBEBEB" height=4>
</td>
</tr>
<tr>
<td bgcolor="#0000CC" height=4>
</td>
</tr>
</table>
<form name="validCancel" action="u_gspw016.apw" method="post">
<input type="hidden" value="X" name="notaOK">
</form>
<form name="validNota" action="u_gspw018.apw" method="post">
<input type="hidden" value=" " name="Imprimiu">
</form>
</body>
</html>