function Enviar(){ if ( Verifica() ){ var url = "http://www.colegio24horas.com.br/bb2007/prova/cadastrar.asp"; CadastroGlobo.action = url; CadastroGlobo.submit(); } } function Verifica(){ if(document.CadastroGlobo.Nome.value==""){ alert("É imprescindível o preenchimento do\ncampo referente ao nome"); document.CadastroGlobo.Nome.focus(); return ; } valor = "" for( var i = 0; i < document.CadastroGlobo.Sexo.length; i++ ) if (document.CadastroGlobo.Sexo[i].checked) valor = document.CadastroGlobo.Sexo[i].value; if( valor == "" ){ alert("É imprescindível o preenchimento do\ncampo referente ao sexo"); document.CadastroGlobo.Sexo[0].focus(); return; } if(document.CadastroGlobo.Ano.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente ao Ano de Nascimento"); document.CadastroGlobo.Ano.focus(); return ; } if( ENumerico( document.CadastroGlobo.Ano.value ) == false ){ alert("Informação inválida no campo referente\nao Ano de Nascimento"); document.CadastroGlobo.Ano.value = ""; document.CadastroGlobo.Ano.focus(); return; } if( ( document.CadastroGlobo.Ano.value ) > 1995 ){ alert("Valor do ano inválido"); document.CadastroGlobo.Ano.focus(); return false; } if( !( document.CadastroGlobo.Ano.value.length == 4 ) ){ alert("O Ano deve conter 4 dígitos" ); document.CadastroGlobo.Ano.focus(); return; } if(document.CadastroGlobo.InfEmail.value == "" ){ alert("É imprescindível o preenchimento do campo\nreferente ao e-mail"); document.CadastroGlobo.InfEmail.focus(); return; } if ( !verificaemail(document.CadastroGlobo.InfEmail.value) ) { alert("Por favor, informe-nos um email válido."); document.CadastroGlobo.InfEmail.focus(); return; } /* if(document.CadastroGlobo.ConfEmail.value == "" ){ alert("É imprescindível o preenchimento do campo\nreferente à confirmação do e-mail"); document.CadastroGlobo.ConfEmail.focus(); return; } if((document.CadastroGlobo.ConfEmail.value)!=(document.CadastroGlobo.InfEmail.value)){ alert("Os campos referentes ao Email e\nsua confirmação devem ser iguais."); document.CadastroGlobo.ConfEmail.focus(); return; } */ if(document.CadastroGlobo.Formacao.value == "" ){ alert("É imprescindível o preenchimento do campo\nreferente à formação"); document.CadastroGlobo.Formacao.focus(); return; } /* if((document.CadastroGlobo.ConfEmail.value)!=(document.CadastroGlobo.InfEmail.value)){ alert("Os campos referentes à escolha do e-mail e\nsua confirmação devem ser iguais."); document.CadastroGlobo.ConfEmail.focus(); return; } */ /* if(document.CadastroGlobo.Endereco.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente ao endereço"); document.CadastroGlobo.Endereco.focus(); return false; } */ if(document.CadastroGlobo.Bairro.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente ao bairro"); document.CadastroGlobo.Bairro.focus(); return false; } if(document.CadastroGlobo.Cidade.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente à cidade"); document.CadastroGlobo.Cidade.focus(); return false; } if(document.CadastroGlobo.Estados.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente ao estado"); document.CadastroGlobo.Estados.focus(); return false; } /* if(document.CadastroGlobo.CEP.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente ao CEP"); document.CadastroGlobo.CEP.focus(); return false; } */ valor = "" for( var i = 0; i < document.CadastroGlobo.JaFezConcurso.length; i++ ) if (document.CadastroGlobo.JaFezConcurso[i].checked) valor = document.CadastroGlobo.JaFezConcurso[i].value; if( valor == "" ){ alert("É imprescindível o preenchimento do campo referente à\n informação sobre cursos preparatórios."); document.CadastroGlobo.JaFezConcurso[0].focus(); return; } if(document.CadastroGlobo.MatDidatico.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente à compra de material didático "); document.CadastroGlobo.MatDidatico.focus(); return false; } if(document.CadastroGlobo.Motivos.value == ""){ alert("É imprescindível o preenchimento do campo\nreferente à motivação para fazer a \nprova do Banco do Brasil"); document.CadastroGlobo.Motivos.focus(); return false; } valor = "" for( var i = 0; i < document.CadastroGlobo.OutrosConcursos.length; i++ ) if (document.CadastroGlobo.OutrosConcursos[i].checked) valor = document.CadastroGlobo.OutrosConcursos[i].value; if( valor == "" ){ alert("É imprescindível o preenchimento do campo referente à\nsua participação em outros concursos."); document.CadastroGlobo.OutrosConcursos[0].focus(); return; } return true; } function ENumerico( Valor ){ numeros = "0123456789"; for(i=0;i<=Valor.length-1;i++){ if (numeros.indexOf(Valor.charAt(i)) == -1){ return false; }}} function verificaemail(vlremail) { stremail = vlremail; while (true) { if (stremail.charAt(0) != " " ) { break; } stremail = stremail.substring(1,stremail.length) } while (true) { if (stremail.charAt(stremail.length-1) != " ") { break; } stremail = stremail.substring(0,stremail.length-1) } if (stremail == "") { return false; } if ( stremail.indexOf('@',0) == -1 || stremail.indexOf('.',0) == -1 || stremail.indexOf('..',0) > -1 || stremail.charAt(stremail.length-1) == "." ) { return false; } validos = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@-_' n_arroba = 0 n_total = stremail.length for (i=0;i < n_total ;i++){ if (validos.indexOf(stremail.charAt(i))==-1){ return false; } if (stremail.charAt(i) == '@') { n_arroba = n_arroba+1 if (n_arroba == 2) { return false } } } return true; } function esquecisenha() { if(document.LoginBB.email.value == "" ){ alert("É imprescindível o preenchimento do campo\nreferente ao e-mail"); document.LoginBB.email.focus(); return; } if ( !verificaemail(document.LoginBB.email.value) ) { alert("Por favor, informe-nos um email válido."); document.LoginBB.email.focus(); return; } var url = "http://www.colegio24horas.com.br/bb2007/prova/esquecisenha.asp"; LoginBB.action = url; LoginBB.submit(); }