JAVASCRIPT Validando um Texto – Funções: Alert(); Valida();

// Alertas (mensagens)
function alerta(msg, obj, foco, topo)
{
alert(msg);
if (!foco)
obj.focus();
if (topo)
document.location = ‘#’ + topo;
return false;
}
// Valida
function Valida()
{
with(document.formCadastroMissa)
{
if (strNomes.value == ”)
return alerta(“Preencha os nomes.”, strNomes);
else
if (strParticipar[0].checked!=true && strParticipar[1].checked!=true)
return alerta(“Escolha a opção que você deseja participar.”, strParticipar[0]);
else

return true;
}
}

Publicado em PHP. Leave a Comment »

Deixar uma Resposta