Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/07/2008, 15:33
[email protected]
 
Fecha de Ingreso: octubre-2005
Mensajes: 405
Antigüedad: 18 años, 6 meses
Puntos: 1
Error en script de validacion !!!!

Ayuda con este error!
Linea 76
Caracter 69
Error Constante de cadena sin terminar
Codigo 0


<script languaje="javascript">
function contar() {
var contar = 0;
var exacto = 0;
var f = document.Guias
var docto = false;
for (i=0; i < f.guias.length; i++)
{
if (f.guias[i].checked == true)
{
contar = contar + 1;
docto = true;
}

}
if (docto == true )
{
revisar();
if(contar == exacto)
{
alert("Revision Terminada satisfactoriamente..!");
return true;
}
}
if (docto == false)
{
var x;
var cont = 0;
ok=document.getElementByName("paq");
for(x=0;x < ok.length; x++)
{
if(ok[x] > 0)
{
cont=cont+1;
}
}
if (cont > 0)
{
alert("Tienes bultos con cantidades; pero no has seleccionado documento..!")
return false;
}
else
{
alert("No has seleccionado Documento ni bultos...!")
return false;
}
}

}


function revisar()
{
var docto = f.guias[i];
var valor = docto.substring(0,3);
var j;
var itemb;
var bulto;
var sw = 0;
var ko=document.getElementByName("paq");
for(j=0;j < ko.length; j++)
{
itemb=ko[j].substring(0,3);
bulto=ko[j].substring(4,6);
if (valor == itemb)
{
if(bulto > 0)
{
exacto = exacto + 1;
sw=1;
}
}
}
if( sw == 0 )
{
alert("Documentos no tiene asociado cantidad de bultos...!);
return false;
}
}
</script>

<form name="Guias" id="Guias" method="post" action="../../cgi-bin/cldesboiin.sh" Onsubmit="return contar()">
<table>
<tr>
<td align=center>
<input type="checkbox" name="guias" value=%%item%%%%tipo%%%%numero%%>
</td>
<td>
<input type=text name="bulto" size=3 maxlength=3 onkeypress="
vent.keyCode < 48 || event.Code > 57) event.returnValue = false;">
<input type=hidden name="paq" value="%%item%%%%bulto%%">
</td>
</tr>

</table>
</form>

Los <tr> son iterativos dependiendo de la cantidad de documentos sin despacho.

Cualquier ayuda sera bienvenida desde ya gracias.