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].value, 10);
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 i = 1; i < nTexts; i++){
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>