Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/11/2009, 08:34
warbandit69
 
Fecha de Ingreso: diciembre-2008
Ubicación: http://www.solucionesrios.tk/
Mensajes: 413
Antigüedad: 15 años, 5 meses
Puntos: 19
Dudas/Problemas con validaciones

Hola foreros, gracias por leer mi post, resulta tengo el siguiente problema, estoy haciendo una serie de validaciones con javascript, y estoy intentando en mi formulario que al activar un checkbox (nuevobarco), este me habilite un input (imonuevo), y cuando esa condicion exista me evalue lo que el usuario ponga en el input, pero no me esta realizando dicha comprobacion (todo lo demas lo realiza bien a excepecion de cuando esxiste esa condicion que no realiza nada), escribo las lineas a continuacion a ver si me ayudan

Código:
function validar();
{
if(!document.form1.nuevobarco.checked && madeSelectionIMO(IMO,"Please select a ship IMO")){				
if(document.form1.nuevobarco.checked && notEmpty(imonuevo, "Please enter the new Ship IMO")) {
return true;
}
}
return false;
}

function madeSelectionIMO(elem, helperMsg){
	if(elem.value == "Select IMO..."){
		alert(helperMsg);
		elem.focus();
		return false;
	}else{
		return true;
	}
}

function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}
Espero puedan ayudarme a solventar este problema, gracias.