Foros del Web » Programando para Internet » Javascript »

Miren... donde está el error?

Estas en el tema de Miren... donde está el error? en el foro de Javascript en Foros del Web. Código PHP: < script language = "JavaScript" >  function  FValidateControl3 ( control , nombre ){   if ( control . value == "" ){     alert ( nombre ...
  #1 (permalink)  
Antiguo 20/08/2003, 15:38
Avatar de dobled  
Fecha de Ingreso: enero-2002
Ubicación: Rancagua - Chile
Mensajes: 1.328
Antigüedad: 22 años, 3 meses
Puntos: 2
Miren... donde está el error?

Código PHP:
<script language="JavaScript">
 function 
FValidateControl3(control,nombre){
  if (
control.value==""){
   
alert(nombre+" es un campo requerido y debe ingresarse.");
   
control.focus();
   return 
false;
  }
  return 
true;
 }

 function 
FSubmitValidation3(form){
  var 
nTexts   parseInt(document.frm.nro_tintas[document.frm.nro_tintas.selectedIndex].value10);
  var 
sValida  document.frm.impresion[document.frm.impresion.selectedIndex].value;
  var 
sCliente document.frm.esp_cliente[document.frm.esp_cliente.selectedIndex].value;
  var 
sMatriz  document.frm.matriz[document.frm.matriz.selectedIndex].value;
  var 
sNueva   document.frm.matriz_n_e[document.frm.matriz_n_e.selectedIndex].value;
  var 
sClise   document.frm.clise[document.frm.clise.selectedIndex].value;
  var 
sItem    document.frm.tipo_item[document.frm.tipo_item.selectedIndex].value;

  if (!
FValidateControl3(form.id_cliente,"Rut del Cliente")) return false
  
if (!FValidateControl3(form.ciudad,"Lugar de Despacho ")) return false
  
if (!FValidateControl3(form.producto,"Descripción del Producto")) return false
  
if (!FValidateControl3(form.contenido,"Contenido")) return false
  
if (!FValidateControl3(form.asistente,"Asistente")) return false
  
if (!FValidateControl3(form.nombre_cliente,"Nombre del Cliente")) return false
  
if (!FValidateControl3(form.moneda,"Moneda")) return false
  
if (!FValidateControl3(form.mercado,"Mercado")) return false
  
if (!FValidateControl3(form.destino,"Destino")) return false

  
if (!FValidateControl3(form.cant_items,"Cantidad de Items")) return false
  
if (!FValidateControl3(form.adj_info,"Descripción del Producto")) return false
//if (!FValidateControl3(form.anula_re_prod,"Anula o Reemplaza Producto")) return false
  
if (!FValidateControl3(form.cant_cajas_pedido,"Cantidad de Cajas x Pedido")) return false
  
if (!FValidateControl3(form.proy_ventas,"Proyección de Ventas")) return false
  
if (!FValidateControl3(form.tol_despacho,"Tolerancia de Despacho")) return false
  
if (!FValidateControl3(form.envasado,"Envasado")) return false
  
if (!FValidateControl3(form.almacenamiento,"Almacenamiento")) return false

  
if (!FValidateControl3(form.tipo_item,"Tipo de Componente")) return false
if (sItem == "TABRTS"){
  if (!
FValidateControl3(form.largo_int,"Largo Interior")) return false
  
if (!FValidateControl3(form.ancho_int,"Ancho Interior")) return false
  
if (!FValidateControl3(form.alto_int,"Alto interior")) return false
   
} else {

  if (!
FValidateControl3(form.tipo_caja,"Tipo de Caja")) return false
  
if (!FValidateControl3(form.largo_int,"Largo Interior")) return false
  
if (!FValidateControl3(form.ancho_int,"Ancho Interior")) return false
  
if (!FValidateControl3(form.alto_int,"Alto interior")) return false
  
if (!FValidateControl3(form.traslapo,"Traslapo")) return false
  
if (!FValidateControl3(form.recubrimiento,"Recubrimiento")) return false
  
if (!FValidateControl3(form.carton,"Carton")) return false
  
if (!FValidateControl3(form.union_lateral,"Union Lateral")) return false
  
if (!FValidateControl3(form.lengueta,"Lengueta")) return false
  
if (!FValidateControl3(form.gap,"Gap")) return false
  
if (!FValidateControl3(form.jalador,"Jalador")) return false
  
if (!FValidateControl3(form.r_ptoflat,"Rayado Pto.Flat")) return false
  
}
  if (!
FValidateControl3(form.impresion,"Impresion")) return false
if (sValida == "SI"){
  if (!
FValidateControl3(form.porc_impresion,"Porcentaje de Impresion")) return false
  
if (!FValidateControl3(form.nro_tintas,"N° de Tintas")) return false

//  if (!FValidateControl3(form.clise,"Clise")) return false
//  if (!FValidateControl3(form.tipo_clise,"Tipo de Clise")) return false
//  if (!FValidateControl3(form.nro_clise,"N° Clise")) return false

    
for (var 1nTextsi++){
    
oCntrl document.getElementById("Tinta" String(i));
    if (!
FValidateControl3(oCntrl,"Tinta" String(i))) return false;
   }
  if (!
FValidateControl3(form.logo,"Logo")) return false
  
if (!FValidateControl3(form.matriz,"Matriz")) return false

if (sMatriz == "SI"){
   if (!
FValidateControl3(form.matriz_n_e,"Nueva / Existente")) return false

if (sNueva == "NUEVA"){
     if (!
FValidateControl3(form.nro_cad,"N° CADDDDD")) return false
     
} else {
     if (!
FValidateControl3(form.nro_matriz,"N° Matrizx")) return false
     
}
if (
sClise == "EXISTENTE"){
     if (!
FValidateControl3(form.nro_matriz,"N° Matrizz")) return false
     
} else {
     if (!
FValidateControl3(form.tipo_clise,"Tipo de Cliseeeee")) return false
   
}
if (
sCliente == "SI"){
      if (!
FValidateControl3(form.tipo_pallet,"Tipo Pallet")) return false
      
if (!FValidateControl3(form.uni_paq,"Unidades x Paquete")) return false
      
if (!FValidateControl3(form.uni_pallet,"Inidades x Pallets ")) return false
      
if (!FValidateControl3(form.stretch_film,"Stretch Film")) return false
      
if (!FValidateControl3(form.pallet_completo,"Pallet Completo")) return false
   
} else {
     if (!
FValidateControl3(form.cto_sr,"Contacto")) return false
     
if (!FValidateControl3(form.mail,"Mail del Contacto")) return false
   
}
 } else
if (
sCliente == "SI"){
       if (!
FValidateControl3(form.tipo_pallet,"Tipo Pallet")) return false
       
if (!FValidateControl3(form.uni_paq,"Unidades x Paquete")) return false
       
if (!FValidateControl3(form.uni_pallet,"Inidades x Pallets ")) return false
       
if (!FValidateControl3(form.stretch_film,"Stretch Film")) return false
       
if (!FValidateControl3(form.pallet_completo,"Pallet Completo")) return false
 
} else {
      if (!
FValidateControl3(form.cto_sr,"Contacto")) return false
      
if (!FValidateControl3(form.mail,"Mail del Contacto")) return false
    
}
   }
   return 
true;
}
</script> 
cuando el sValida sea no quiero que revise el campo contacto pero pasa de largo no lo valida buaaaa
__________________
Usa títulos específicos y con sentido
En las listas de correo o en los grupos de noticias, la cabecera del mensaje es tu oportunidad de oro para atraer la atención de expertos cualificados en aproximadamente 50 caracteres o menos. No los desperdicies en balbuceos como "Por favor ayúdame" (de "POR FAVOR AYÚDAME!!!" ya ni hablamos). No intentes impresionarnos con lo profundo de tu angustia; mejor usa ese preciado espacio para una descripción lo más concisa posible del problema.
  #2 (permalink)  
Antiguo 20/08/2003, 19:37
Avatar de biblio  
Fecha de Ingreso: enero-2002
Ubicación: Urano
Mensajes: 577
Antigüedad: 22 años, 3 meses
Puntos: 0
Jaja, quieres que miren el error?, será mejor que pongas completo, me refiero al form y sus elemnetos.

Saludos
  #3 (permalink)  
Antiguo 21/08/2003, 07:37
Avatar de dobled  
Fecha de Ingreso: enero-2002
Ubicación: Rancagua - Chile
Mensajes: 1.328
Antigüedad: 22 años, 3 meses
Puntos: 2
Aqui esta el Form
__________________
Usa títulos específicos y con sentido
En las listas de correo o en los grupos de noticias, la cabecera del mensaje es tu oportunidad de oro para atraer la atención de expertos cualificados en aproximadamente 50 caracteres o menos. No los desperdicies en balbuceos como "Por favor ayúdame" (de "POR FAVOR AYÚDAME!!!" ya ni hablamos). No intentes impresionarnos con lo profundo de tu angustia; mejor usa ese preciado espacio para una descripción lo más concisa posible del problema.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:58.