Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/02/2016, 10:32
ZedGe1505
 
Fecha de Ingreso: junio-2011
Mensajes: 289
Antigüedad: 12 años, 10 meses
Puntos: 15
Respuesta: Validar un checkbox

Utiliza esto

Código Javascript:
Ver original
  1. var error_count =0
  2. $('input[name="forma_manife[]"]:checked').each(function() {
  3.     error_count ++;
  4. });
  5. error_message = 'Selecciona almenos una opcion en la pregunta 1';
  6.  
  7. if(error_count > 0){
  8. return true;
  9. }else{
  10. alert(error_message);
  11. return false;
  12. }

Y los check pueden ser
Código HTML:
Ver original
  1. <input type="checkbox" name="forma_manife[]" checked>
  2. <input type="checkbox" name="forma_manife[]" >
  3. <input type="checkbox" name="forma_manife[]" >
  4. <input type="checkbox" name="forma_manife[]" checked>