<SCRIPT language=javascript>
function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){
return (false);
}
}
if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);
}
}
}
</SCRIPT>
<SCRIPT>
function check_form(f) {
if(!check_email(f.email.value)){
alert("Email Incorrecto.");
f.email.focus();
}
if(f.email.value == ""){
alert("Por favor Ingrese su Email");
f.email.focus();
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.email.style.background = "cyan";
}
// make sure the form is not submitted
return false;
}
if(f.nombre.value == ""){
alert("Por favor Ingrese su Nombre");
f.nombre.focus();
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.nombre.style.background = "cyan";
}
// make sure the form is not submitted
return false;
}
if(f.tema.value == ""){
alert("Por favor Ingrese el Título Significativo");
f.tema.focus();
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.tema.style.background = "cyan";
}
// make sure the form is not submitted
return false;
}
if(f.coment.value == ""){
alert("Por favor Ingrese un Mensaje");
f.coment.focus();
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.coment.style.background = "cyan";
}
// make sure the form is not submitted
return false;
}
if(f.email.value != f.email2.value){
alert("Los emails ingresados no coinciden");
f.email2.focus();
// if the browser is Netscape 6 or IE
if(document.all || document.getElementByID){
// change the color of text field
f.email2.style.background= "cyan";
}
// make sure the form is not submitted
return false;
}
}
</script> |