Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/07/2008, 10:57
kid
 
Fecha de Ingreso: diciembre-2003
Mensajes: 295
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: Validar solo los campos visibles.

Código HTML:
function mostrarOcultar(box, id, id2, id3, id4)
{ 
	var elm = document.getElementById(id)  
	elm.style.display = box.checked? "inline":"none"
	
	var elm = document.getElementById(id2)  
	elm.style.display = box.checked? "inline":"none"
	
	var elm = document.getElementById(id3)  
	elm.style.display = box.checked? "inline":"none"
	
	var elm = document.getElementById(id4)  
	elm.style.display = box.checked? "inline":"none"
}
Acá mi CheckBox:

Código HTML:
<input name="actividad" type="checkbox" id="actividad" onClick="mostrarOcultar(this, 'cine', 'cine2', 'cine3', 'cine4');" value="checkbox"> 
Obviamente, tambien tengo una capa con cine, cine2, cine3 y cine4.

Código HTML:
<div id="cine2">
<table width="730" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="160" class="texto_chico">Cine</td>
<td width="200" class="texto_chico"><input name="cine" type="radio" value="radiobutton">
1 vez al mes </td>
<td width="200" class="texto_chico"><input name="cine" type="radio" value="radiobutton">
Entre 2 y 3 veces al mes </td>
<td width="200" class="texto_chico"><input name="cine" type="radio" value="radiobutton">
M&aacute;s de 4 veces al mes </td>
</tr>
</table>
</div> 
Mi pregunta es: como validar ESOS campos, cuando ESA capa este visible :D

Saludos!