469,342 Members | 5,667 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,342 developers. It's quick & easy.

problem function validate

I am not good in Javascript I begin I do not understand why my function does
not go I post my code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>contact.html</title>
<meta name="generator" content="Bluefish 1.0.7">
<meta name="author" content="swilting">
<meta name="date" content="2007-02-09T13:41:56+0100">
<meta name="copyright" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type"
content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
<meta http-equiv="refresh" content="5; URL=http://">

</head>
<script type="application/x-javascript">
function validate()
{
if(document.info.nom.value=="")
{
alert("vous devez entrer votre nom.")
return false
}
if(document.info.prenom.value=="")
{
alert("vous devez entrer votre prenom.")
return false
}
if(document.info.mail.value=="")
{
alert("vous devez entrer votre mail.")
return false
}
if(document.info.body.value==")
{
alert("vous devez ecrire du texte dans le mail.")
return false
}
}

//-->
</script>
<body>

<table style="width: 100%;text-align: center;" border="1"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><img
src="http://localhost/cgi-bin/random_image.cgi" align="middle"
border="0"><br>
</td>
</tr>
</tbody>
</table>
<br>
<hr style="width: 100%; height: 2px;"><br>
<table style="width: 100%;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;">
<form name="info" onsubmit="return validate()"
action="http://localhost/cgi-bin/mailperso.cgi" method="post"
enctype="multipart/form-data">
<br>
<hr style="width: 100%; height: 2px;"><br>
<p>vous pouvez m envoyer des e-mails personnalises pour que je travaille sur
vous idees</p>
<p>nom [obligatoire]</p>
<p></p>
<input type="text" name="nom" size="100" maxlength="100">
<p></p>
<p>prenom [obligatoite]</p>
<p></p>
<input type="text" name="prenom" size="100" maxlength="100">
<p></p>
<p>adresse mail [pas obligatoire]</p>
<input type="text" name="mail" size="100" maxlength="100">
<P>vous pouvez envoyer des images au format gif [pas obligatoire]</p>
<input type="file" name="attachement" size="50" maxlength="50">
<p>entrer le maximum d'information pour que l artiste travaille sur vos
idees</p>
<p>si vous n'avez pas remplie le champ mail indiquer votre numero de
telephone</p>
<textarea name="body" rows="5" cols="50"></textarea>
<p><input type="submit"></p>
</form><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</body>
</html>

Feb 9 '07 #1
1 1417
john.swilting wrote:
I am not good in Javascript I begin I do not understand why my function does
not go I post my code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>contact.html</title>
<meta name="generator" content="Bluefish 1.0.7">
<meta name="author" content="swilting">
<meta name="date" content="2007-02-09T13:41:56+0100">
<meta name="copyright" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type"
content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
<meta http-equiv="refresh" content="5; URL=http://">

</head>
<script type="application/x-javascript">
function validate()
{
if(document.info.nom.value=="")
{
alert("vous devez entrer votre nom.")
return false
}
if(document.info.prenom.value=="")
{
alert("vous devez entrer votre prenom.")
return false
}
if(document.info.mail.value=="")
{
alert("vous devez entrer votre mail.")
return false
}
if(document.info.body.value==")
if(document.info.body.value=="")

Mick
{
alert("vous devez ecrire du texte dans le mail.")
return false
}
}

//-->
</script>
<body>

<table style="width: 100%;text-align: center;" border="1"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><img
src="http://localhost/cgi-bin/random_image.cgi" align="middle"
border="0"><br>
</td>
</tr>
</tbody>
</table>
<br>
<hr style="width: 100%; height: 2px;"><br>
<table style="width: 100%;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;">
<form name="info" onsubmit="return validate()"
action="http://localhost/cgi-bin/mailperso.cgi" method="post"
enctype="multipart/form-data">
<br>
<hr style="width: 100%; height: 2px;"><br>
<p>vous pouvez m envoyer des e-mails personnalises pour que je travaille sur
vous idees</p>
<p>nom [obligatoire]</p>
<p></p>
<input type="text" name="nom" size="100" maxlength="100">
<p></p>
<p>prenom [obligatoite]</p>
<p></p>
<input type="text" name="prenom" size="100" maxlength="100">
<p></p>
<p>adresse mail [pas obligatoire]</p>
<input type="text" name="mail" size="100" maxlength="100">
<P>vous pouvez envoyer des images au format gif [pas obligatoire]</p>
<input type="file" name="attachement" size="50" maxlength="50">
<p>entrer le maximum d'information pour que l artiste travaille sur vos
idees</p>
<p>si vous n'avez pas remplie le champ mail indiquer votre numero de
telephone</p>
<textarea name="body" rows="5" cols="50"></textarea>
<p><input type="submit"></p>
</form><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</body>
</html>
Feb 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by z24 | last post: by
8 posts views Thread by Arthur Rusdell-Wilson | last post: by
1 post views Thread by kusanagihk | last post: by
1 post views Thread by Nacho | last post: by
1 post views Thread by John | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.