I hope not sent I twice.
ok here is my problem,
the javascript form validation works perfect during I put a
emaildirection in the <form action:""> comand, like this:
<form action="mailto: bu**********@gm x.net" method="post"
name="formulari o"
id="formulario " onSubmit="retur n chkFormular()">
but when I change it like this:
<form action="/cgi-bin/formmail" method="post" name="formulari o"
id="formulario " onSubmit="retur n chkFormular()">
AND I ADD these two lines!!:
<input type=hidden name=email value="bu****** ****@gmx.net">
<input type=hidden name=url
value="http://www.butacasalad a.tk/main.htm">
it sends me the form data but without javascript starting a
validation, it is like the form ignores all the javascript I wrote!!!
IS there some way to tell the /cgi-bin/formmail to send all the form
data to my emaildirection without writing these lines:
<input type=hidden name=email value="bu****** ****@gmx.net">
<input type=hidden name=url
value="http://www.butacasalad a.tk/main.htm">
???????????
please help, I am so close to finish my web work.
regards
Francisco
following the complete script:
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="JavaS cript" type="text/javascript">
function checkEmail(str) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3 })+$/.test(str)){
return true;
} return false;
}
function chkFormular()
{
var checkOK =
"ABCDEFGHIJKLMN OPQRSTUVWXYZabc defghijklmnopqr stuvwxyzƒŠŒšœŸÀ ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÐÑÒÓÔÕÖØÙÚÛÜÝÞß àáâãäåæçèéêëìíî ïðñòóôõöøùúûüýþ 0123456789--._@";
var checkStr = document.formul ario.email.valu e;
var allValid = true;
for (i = 0; i < checkStr.length ; i++)
{
ch = checkStr.charAt (i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt( j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("A ver pavo estas utilizando signos no permitidos para un
email, revísalo!");
document.formul ario.email.focu s();
return (false);
}
var checkOKa =
"ABCDEFGHIJKLMN OPQRSTUVWXYZabc defghijklmnopqr stuvwxyzƒŠŒšœŸÀ ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÐÑÒÓÔÕÖØÙÚÛÜÝÞß àáâãäåæçèéêëìíî ïðñòóôõöøùúûüýþ ";
var checkStra = document.formul ario.nombre.val ue;
var allValid = true;
for (q = 0; q < checkStra.lengt h; q++)
{
ch = checkStra.charA t(q);
for (d = 0; d < checkOKa.length ; d++)
if (ch == checkOKa.charAt (d))
break;
if (d == checkOKa.length )
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("A ver chavalote revisa tu nombre!");
document.formul ario.nombre.foc us();
return (false);
}
if(document.for mulario.nombre. value.length < 2){
alert("no me creo que este sea tu nombre, revisa tu nombre!");
document.formul ario.nombre.foc us();
return false;
}
if(document.for mulario.nombre. value == "") {
alert("Introduc e tu nombre!");
document.formul ario.nombre.foc us();
return false;
}
if(document.for mulario.email.v alue == "") {
alert("Introduc e tu email!");
document.formul ario.email.focu s();
return false;
}
if(document.for mulario.email.v alue.indexOf('@ ') == -1) {
alert("a ver amigo te has dejado la @ en tu email!");
document.formul ario.email.focu s();
return false;
}
var arsch = "@."
if(document.for mulario.email.v alue.indexOf(ar sch) > -1) {
alert("tio, tu email no es correcto!");
document.formul ario.email.focu s();
return false;
}
if(document.for mulario.email.v alue.indexOf('. ') == -1) {
alert("a ver chaval te has dejado un punto en tu email!");
document.formul ario.email.focu s();
return false;
}
if(document.for mulario.email.v alue.length < 6){
alert("macho tu email aún no esta bien!");
document.formul ario.email.focu s();
return false;
}
if(!checkEmail( document.formul ario.email.valu e)) {
alert("que eres disléxico, o no sabes poner tu email
correctamente?! ");
document.formul ario.email.focu s();
return false;
}
var bunker =/^([_a-zA-Z0-9-]+)(\.[a-zA-Z0-9-_]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/;
if (!bunker.test(d ocument.formula rio.email.value ))
{
alert("me tomas el pelo? revisa tu email!");
document.formul ario.email.focu s();
return false;
}
var badwords=new Array("puta","p uto","p.uta","p .uto","mierda", "cabr","cerdo", "nazi","mam on",
"mamón", "maric", "monyas" , "culo", "polla", "poya" ,"merda" ,
"imbecil", "chupar", "chupa", "chúpa", "imbeciles" ,
"jode","capullo ","capuyo") ;
var ffwords=documen t.formulario.co mentario.value. toLowerCase();
for (i=0; i<badwords.leng th; i++) {
if (ffwords.indexO f(badwords[i])!= -1) {
alert("amigo, revisa tu comentario porque has introducido un insulto,
intenta ser diplomático!");
document.formul ario.comentario .focus();
return false;
}
}
if(document.for mulario.alias.v alue == "") {
alert("Introduc e tu nickname o alias!");
document.formul ario.alias.focu s();
return false;
}
var checkOKak = "ABCDEFGHIJKLMN OPQRSTUVWXYZabc defghijklmnopqr stuvwxyzƒŠŒšœŸÀ ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÐÑÒÓÔÕÖØÙÚÛÜÝÞß àáâãäåæçèéêëìíî ïðñòóôõöøùúûüýþ ";
var checkStrat = document.formul ario.apellido.v alue;
var allValidt = true;
for (q = 0; q < checkStrat.leng th; q++)
{
ch = checkStrat.char At(q);
for (d = 0; d < checkOKak.lengt h; d++)
if (ch == checkOKak.charA t(d))
break;
if (d == checkOKak.lengt h)
{
allValidt = false;
break;
}
}
if (!allValidt)
{
alert("revisa tu apellido!");
document.formul ario.apellido.f ocus();
return (false);
}
if(document.for mulario.nombrep eli.value == "") {
alert("Introduc e el nombre de la peli!");
document.formul ario.nombrepeli .focus();
return false;
}
if(document.for mulario.critica peli.value == "") {
alert("Pon tu crítica de la peli, por favor!");
document.formul ario.criticapel i.focus();
return false;
}
if(document.for mulario.critica peli.value.leng th < 40){
alert("referent e a la crítica de la peli que has escrito, pon un
poco más, no seas tan breve, por ejemplo siempre esta bién en poner
una pequeñísima sinopsis!");
document.formul ario.criticapel i.focus();
return false;
}
if(document.for mulario.element s[7].checked==false &&
document.formul ario.elements[8].checked==false &&
document.formul ario.elements[9].checked==false &&
document.formul ario.elements[10].checked==false ) {alert("por favor
valora la página web butacasalada");
document.formul ario.elements[7].focus();
return false;
}
if(document.for mulario.element s[12].checked==false &&
document.formul ario.elements[13].checked==false &&
document.formul ario.elements[14].checked==false &&
document.formul ario.elements[15].checked==false &&
document.formul ario.elements[16].checked==false &&
document.formul ario.elements[17].checked==false &&
document.formul ario.elements[18].checked==false ) {alert("por favor
selecciona una o más secciones, por ejemplo peli actual y también
mejor peli del mes o simplemente peli actual!");
document.formul ario.elements[12].focus();
return false;
}
if(document.for mulario.element s[21].checked==false &&
document.formul ario.elements[22].checked==false &&
document.formul ario.elements[23].checked==false &&
document.formul ario.elements[24].checked==false &&
document.formul ario.elements[25].checked==false &&
document.formul ario.elements[26].checked==false &&
document.formul ario.elements[27].checked==false ) {alert("por favor,
valora la peli que has visto, gracias!");
document.formul ario.elements[21].focus();
return false;
}
}
</script>
</head>
<body bgcolor="#99999 9">
<form action="/cgi-bin/formmail" method="post" name="formulari o"
id="formulario " onSubmit="retur n chkFormular()">
<input type=hidden name=email value="bu****** ****@gmx.net">
<input type=hidden name=url
value="http://home.arcor.de/butacasalada/main.htm">
<p align="justify" ><br>
</p>
<p>tu nombre*:
<input name="nombre" type="text" id="nombre" value="">
</p>
<p>pon aqui tu alias o nickname*:
<input name="alias" type="text" id="alias">
</p>
<p>tu apellido:
<input name="apellido" type="text" id="apellido">
</p>
<p> tu emai*:
<input name="email" type="text" id="email">
</p>
<p>selecciona tu país:
<SELECT name=pais size=1 VALUE="">
<option value="SPAIN" selected>ESPA&N tilde;A</option>
<option value="AFGHANIS TAN">AFGHANISTA N</option>
<option value="ALBANIA" >ALBANIA</option>
<option value="Alemania ">ALEMANIA</option>
<option value="ANDORRA" >ANDORRA</option>
</SELECT>
</p>
<p> tienes página web? pon la direcció n completa (ej.
http://www.google.com)
aqui.
<input name="url" type="text" id="url">
</p>
<p>nos recomiendas una página web? pon la direcció n
completa (ej.
http://www.google.com) aqui.
<input name="links" type="text" id="links">
</p>
<p>que valoració ;n das al portal butacasalada* ?</p>
<table width="292">
<tr>
<td width="110"><la bel>
<input type="radio" name="valoracio nweb" value="mala">
mala</label></td>
<td width="121" bgcolor="#00000 0"><div align="center"> <img
src="kaka.jpg" width="38" height="39"></div></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio nweb" value="regular" >
regular</label></td>
<td bgcolor="#00000 0"><div align="center"> <img src="STAR.jpg"
width="26" height="26"></div></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio nweb" value="buena">
buena</label></td>
<td bgcolor="#00000 0"><div align="center"> <img src="STAR.jpg"
width="26" height="26"><im g src="STAR.jpg" width="26"
height="26"></div></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio nweb" value="muy buena">
muy buena</label></td>
<td bgcolor="#00000 0"><div align="center"> <img src="STAR.jpg"
width="26" height="26"><im g src="STAR.jpg" width="26" height="26"><im g
src="STAR.jpg" width="26" height="26"></div></td>
</tr>
</table>
<p> </p>
<p>tienes alguna idea de como mejorar el portal?, algún
comentario?</p>
<p>
<textarea name="comentari o" cols="50" rows="4"
id="comentario" ></textarea>
</p>
<p>ok una vez rellenado las formalidades, es la hora de que digas tu
opinion,
selecciona primero la seccion adecuada*:</p>
<p>
<input name="imageFiel d" type="image" src="aabutacaac tual.jpg"
width="60" height="74" border="0">
peli actual
<input type="checkbox" name="checkbox" value="seccionp eliactual">
</p>
<p>
<input name="imageFiel d4" type="image" src="aaTRUNYOME S.jpg"
width="60" height="74" border="0">
peor peli mes
<input type="checkbox" name="checkbox2 "
value="seccionp eorpelimes">
<input name="imageFiel d5" type="image" src="aaTRUNYOan o.jpg"
width="60" height="74" border="0">
peor peli año
<input type="checkbox" name="checkbox3 "
value="seccionp eorpeliano">
<input name="imageFiel d6" type="image" src="aahallofsh ame.jpg"
width="60" height="74" border="0">
peor peli de la historia
<input type="checkbox" name="checkbox4 " value="seccions hame">
</p>
<p>
<input name="imageFiel d7" type="image" src="aaMEJORMES .jpg"
width="60" height="74" border="0">
mejor peli mes
<input type="checkbox" name="checkbox5 "
value="seccionm ejorpelimes">
<input name="imageFiel d8" type="image" src="aamejorano .jpg"
width="60" height="74" border="0">
mejor peli año
<input type="checkbox" name="checkbox6 "
value="seccionm ejorpeliano">
<input name="imageFiel d9" type="image" src="aaBUTACADE ORO.jpg"
width="60" height="74" border="0">
mejor peli de la historia
<input type="checkbox" name="checkbox7 " value="secciono ro">
</p>
<p><br>
nombre de la peli*:
<input name="nombrepel i" type="text" id="nombrepeli " size="80">
</p>
<p>en que mes has visto la peli:
<select name="mes" id="mes">
<option value="enero" selected>enero</option>
<option value="febrero" >febrero</option>
<option value="marzo">m arzo</option>
<option value="abril">a bril</option>
<option value="mayo">ma yo</option>
<option value="junio">j unio</option>
<option value="julio">j ulio</option>
<option value="agosto"> agosto</option>
<option value="septiemb re">septiembr e</option>
<option value="octubre" >octubre</option>
<option value="noviembr e">noviembre </option>
<option value="diciembr e">diciembre </option>
</select>
</p>
<p>valoraci&oac ute;n de la película *: </p>
<table width="282">
<tr>
<td width="136"><la bel>
<input type="radio" name="valoracio npeli" value="trunyo
total">
trunyo total</label></td>
<td width="201" bgcolor="#00000 0">
<input name="imageFiel d2" type="image" src="kaka.jpg" width="38"
height="39" border="0">
<input name="imageFiel d22" type="image" src="kaka.jpg"
width="38" height="39" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio npeli" value="mala">
mala</label></td>
<td bgcolor="#00000 0">
<input name="imageFiel d23" type="image" src="kaka.jpg" width="38"
height="39" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio npeli" value="regular" >
regular</label></td>
<td bgcolor="#00000 0">
<input name="imageFiel d3" type="image" src="STAR.jpg" width="26"
height="26" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio npeli" value="interesa nte">
interesante</label></td>
<td bgcolor="#00000 0">
<input name="imageFiel d32" type="image" src="STAR.jpg" width="26"
height="26" border="0">
<input name="imageFiel d33" type="image" src="STAR.jpg"
width="26" height="26" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio npeli" value="buena">
buena</label></td>
<td bgcolor="#00000 0">
<input name="imageFiel d34" type="image" src="STAR.jpg" width="26"
height="26" border="0">
<input name="imageFiel d35" type="image" src="STAR.jpg"
width="26" height="26" border="0">
<input name="imageFiel d36" type="image" src="STAR.jpg"
width="26" height="26" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio npeli" value="muy buena">
muy buena</label></td>
<td bgcolor="#00000 0">
<input name="imageFiel d37" type="image" src="STAR.jpg" width="26"
height="26" border="0">
<input name="imageFiel d38" type="image" src="STAR.jpg"
width="26" height="26" border="0">
<input name="imageFiel d39" type="image" src="STAR.jpg"
width="26" height="26" border="0">
<input name="imageFiel d310" type="image" src="STAR.jpg"
width="26" height="26" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio npeli" value="obra
maestra">
obra maestra</label></td>
<td bgcolor="#00000 0">
<input name="imageFiel d311" type="image" src="STAR.jpg" width="26"
height="26" border="0">
<input name="imageFiel d312" type="image" src="STAR.jpg"
width="26" height="26" border="0">
<input name="imageFiel d313" type="image" src="STAR.jpg"
width="26" height="26" border="0">
<input name="imageFiel d314" type="image" src="STAR.jpg"
width="26" height="26" border="0">
<input name="imageFiel d315" type="image" src="STAR.jpg"
width="26" height="26" border="0"></td>
</tr>
</table>
<p>recuerda que una pequeña sinopsis siempre forma parte de
una buena
crítica! <br>
tu crítica de la peli aquí, por favor*:</p>
<p>
<textarea name="criticape li" cols="80"
id="criticapeli "></textarea>
</p>
<p> </p>
<p>lo siguiente es optativo, seguidamente podrás criticar
programas de
la radio, la tele o obras teatrales.</p>
<p>selecciona el medio:</p>
<table width="80">
<tr>
<td><label>
<input type="radio" name="medio" value="radio">
Radio</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="medio" value="tele">
Tele</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="medio" value="teatro">
Teatro</label></td>
</tr>
</table>
<p>nombre del programa o obra de teatro:
<input name="nombremed io" type="text" id="nombremedio " size="60">
</p>
<p>valoraci&oac ute;n:</p>
<table width="200">
<tr>
<td><label>
<input type="radio" name="valoracio nradiotele" value="puta
madre">
buena</label></td>
<td><input name="imageFiel d10" type="image" src="gold.jpg"
width="100" height="84" border="0"></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracio nradiotele" value="mierda">
mala</label></td>
<td><input name="imageFiel d11" type="image" src="dose.jpg"
width="100" height="100" border="0"></td>
</tr>
</table>
<p>tu crítica aqui:</p>
<p>
<textarea name="criticara diotele" cols="80" rows="4"
id="criticaradi otele">tu crítica aquí ...</textarea>
</p>
<p> </p>
<p>
<input type="reset" name="Reset" value="borrar todo">
<input type="submit" name="Submit2" value="enviar" >
<br>
</p>
<p><strong>pa ra <font color="#663366" size="5">salir del
formulario</font> click</strong> <a href="main.htm"
target="mainFra me"><strong><fo nt
size="5">aqui!</font></strong></a><br>
</p>
<p>
<label></label>
<br>
</p>
</form>
</body>
</html>