ok , first of all sorry if my english is not so good, I do my best.
here is my problem:
I don“t know much javascript so I wrote a very simple one to validate
a form I have on my webpage.
could you please have a look at the following script:
------------------------------------------------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script type="text/javascript">
<!--
function chkFormular()
{
if(document.formulario.nombre.value == "") {
alert("Introduce tu nombre!");
document.formulario.nombre.focus();
return false;
}
if(document.formulario.email.value == "") {
alert("Introduce tu email!");
document.formulario.email.focus();
return false;
}
if(document.formulario.email.value.indexOf('@') == -1) {
alert("a ver amigo te has dejado la @ en tu email!");
document.formulario.email.focus();
return false;
}
var arroba = "@."
if(document.formulario.email.value.indexOf(arroba) > -1) {
alert("tio, tu email no es correcto!");
document.formulario.email.focus();
return false;
}
if(document.formulario.email.value.indexOf('.') == -1) {
alert("a ver chaval te has dejado un punto en tu email!");
document.formulario.email.focus();
return false;
}
if(document.formulario.email.value.length < 6){
alert("macho tu email aśn no esta bien!");
document.formulario.email.focus();
return false;
}
}
//-->
</script>
</head>
<body bgcolor="#999999">
<form action="" method="post" enctype="text/plain" name="formulario"
id="formulario" onSubmit="return chkFormular()">
--------------------------------------------------------
don“t laugh at me :-) ,
I know it must be the most stupid javascript you have ever seen, but
it works, the thing is, that I want also check at the email textfield,
if the user has introduced characters like:( $ % / ?) etc..., all
characters which are never part of a valid email. I am still to stupid
to wrote some javascript lines to solve this problem, I tried all day
and finally I gave up, with a big headage.
could you help me out please??? I hope there is a simple trick to
solve my problem. In the same way is there any simple trick to control
if the user had introduced a insult in a textfield?
hope someone can help me ,
regards
Francisco Lopez with a big headage :-)
the next problem I have is not so important but also a one I have a
headage, how to know if someone checked a radiobutton on my form.
here you can see the part of the form where I have the radiobuttons:
----------------------------------------------
<td width="151"><label>
<input type="radio" name="valoracion web" value="mala">
mala</label></td>
<td width="37" bgcolor="#000000"><div align="center"><img
src="kaka.jpg" width="38" height="39"></div></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracion web" value="regular">
regular</label></td>
<td bgcolor="#000000"><div align="center"><img src="STAR.jpg"
width="26" height="26"></div></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracion web" value="buena">
buena</label></td>
<td bgcolor="#000000"><div align="center"><img src="STAR.jpg"
width="26" height="26"><img src="STAR.jpg" width="26"
height="26"></div></td>
</tr>
<tr>
<td><label>
<input type="radio" name="valoracion web" value="muy buena">
muy buena</label></td>
--------------------------------------------------------------