Script de validação não funciona completamente
Pessoal, tenho um javascript que faz as validações dos campos e dos checkbox, só que a parte dos checkboxes não está funcionando, o sistema simplesmente ignora essa parte.
Alguém pode me ajudar?
function valida_agenda(agenda)
{
var lastRow = qtdeCampos;
var i;if ((agenda.data_cad.value=="")||(agenda.tecnologia.value==""))
{
window.alert ('Você precisa informar os dados para cadastro')
return false;
}
for (i=1; i<=lastRow; i++) {
var assunto = document.getElementById('assunto' + i);
if ( assunto.value.length <= 0) {
alert('O Campo Assunto ' + i + ' esta vazia');
return false;
}
var tipo = document.getElementById('tipo' + i);
if ( tipo.value.length <= 0) {
alert('O Campo Tipo ' + i + ' esta vazia');
return false;
}
var apr = document.getElementById('apr' + i);
if (apr.value.length <= 0) {
alert('O campo Apresentador ' + i + ' esta vazia');
return false;
}
var horario = document.getElementById('horario' + i);
if (horario.value.length <= 0) {
alert('O campo Horário ' + i + ' esta vazia');
return false;
}
var duracao = document.getElementById('duracao' + i);
if (duracao.value.length <= 0) {
alert('O campo Duração ' + i + ' esta vazia');
return false;
}
}
if (agenda.comite.checked == false && agenda.apr.checked == false){
if (confirm("You don't select the Committee or Presenters options, would you like to communicate them later?"))
return true;
}
return false;
}
Essa parte o sistema não reconhece, fiz alguma coisa de errado?
if (agenda.comite.checked == false && agenda.apr.checked == false){
if (confirm("You don't select the Committee or Presenters options, would you like to communicate them later?"))
return true;
}
return false;
}Discussão (4)
Carregando comentários...