diana
09-11-2003, 02:02 PM
HY
I have a form with 3 textboxes,then you push ENVOYER-bouton and you send a email....
I want to make the validation for the boxes...
I want ,when he don't write the name a message is comming
and the bouton ENVOYER don't work...
I hope you understand what I want!!!!
I want the people, must complete all the 3 boxes....
HOW CAN I DO iT?
<html>
<head>
<title>Alizé Centre de diffusion Artistique Formulaire </title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function submitForm(sub) {
document.forms[sub].submit();
}
function proceedSubmission() {
return confirm("Appuyez sur OK pour envoyer ces informations");
}
// -->
<!--
function formatMessage(){
var chaineMail="mailto:lupumihai@yahoo.fr";
chaineMail=chaineMail+"?subject="+formulaire.Nom.value;
chaineMail+="&body= Nom :"+formulaire.Nom.value + " " + " tel : " + formulaire.phone.value + " "+ " date :" +formulaire.data.value;
location.href=chaineMail;
}
// -->
</SCRIPT>
<script language="javascript">
function valider(){
// validation pour le nom
var nom1=formulaire.Nom.value;
if (nom1==0){
alert("Erreur!Vous devrez ecrire votre nom");
return;
}
}
</script>
<link href="../gogo.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#666699" text="#ffffff">
<div align="center"></div>
<form name="formulaire" onSubmit="formatMessage();"><br>
<center>
<h3> </h3>
<table width="390" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="320"><div align="center" class="soustitre"><font size="3"><strong>FORMULAIRE
POUR VOUS INSCRIRE</strong></font></div></td>
<td width="45"><img src="emailed.gif" width="45" height="52"></td>
</tr>
</table>
</center>
<table width="395" border="0" cellspacing="5" align="center" cellpadding="5">
<tr>
<td width="151" class="texteNorm"> <div align="center" class="unnamed1">Nom</div></td>
<td width="191"> <input type="text" name="Nom" size="30"> </td>
<td width="8"> </td>
</tr>
<tr>
<td width="151" > <div align="center" class="unnamed1">Téléphone</div></td>
<td width="191"> <input type="text" name="phone" size="30"> </td>
<tr>
<td width="151" valign="top" > <div align="center" class="unnamed1">Date
de l'événements</div></td>
<td width="191"> <input type="text" name="data" size="30"> </td>
<td width="8"> </td>
</tr>
</table>
<p> </p>
<p align="center">
<input type="submit" onClick="valider();" name="Submit" value=" Envoyer" >
<input type="reset" name="Submit2" value="Recommencer">
</p>
</form>
</table>
</body>
</html>
I write the function valider , but the email work!!!
I want ,that the email-bouton don't work,when the people
don't write in all the 3 boxes...
HOW CAN I DO IT?
THKS
DIANA
I have a form with 3 textboxes,then you push ENVOYER-bouton and you send a email....
I want to make the validation for the boxes...
I want ,when he don't write the name a message is comming
and the bouton ENVOYER don't work...
I hope you understand what I want!!!!
I want the people, must complete all the 3 boxes....
HOW CAN I DO iT?
<html>
<head>
<title>Alizé Centre de diffusion Artistique Formulaire </title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function submitForm(sub) {
document.forms[sub].submit();
}
function proceedSubmission() {
return confirm("Appuyez sur OK pour envoyer ces informations");
}
// -->
<!--
function formatMessage(){
var chaineMail="mailto:lupumihai@yahoo.fr";
chaineMail=chaineMail+"?subject="+formulaire.Nom.value;
chaineMail+="&body= Nom :"+formulaire.Nom.value + " " + " tel : " + formulaire.phone.value + " "+ " date :" +formulaire.data.value;
location.href=chaineMail;
}
// -->
</SCRIPT>
<script language="javascript">
function valider(){
// validation pour le nom
var nom1=formulaire.Nom.value;
if (nom1==0){
alert("Erreur!Vous devrez ecrire votre nom");
return;
}
}
</script>
<link href="../gogo.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#666699" text="#ffffff">
<div align="center"></div>
<form name="formulaire" onSubmit="formatMessage();"><br>
<center>
<h3> </h3>
<table width="390" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="320"><div align="center" class="soustitre"><font size="3"><strong>FORMULAIRE
POUR VOUS INSCRIRE</strong></font></div></td>
<td width="45"><img src="emailed.gif" width="45" height="52"></td>
</tr>
</table>
</center>
<table width="395" border="0" cellspacing="5" align="center" cellpadding="5">
<tr>
<td width="151" class="texteNorm"> <div align="center" class="unnamed1">Nom</div></td>
<td width="191"> <input type="text" name="Nom" size="30"> </td>
<td width="8"> </td>
</tr>
<tr>
<td width="151" > <div align="center" class="unnamed1">Téléphone</div></td>
<td width="191"> <input type="text" name="phone" size="30"> </td>
<tr>
<td width="151" valign="top" > <div align="center" class="unnamed1">Date
de l'événements</div></td>
<td width="191"> <input type="text" name="data" size="30"> </td>
<td width="8"> </td>
</tr>
</table>
<p> </p>
<p align="center">
<input type="submit" onClick="valider();" name="Submit" value=" Envoyer" >
<input type="reset" name="Submit2" value="Recommencer">
</p>
</form>
</table>
</body>
</html>
I write the function valider , but the email work!!!
I want ,that the email-bouton don't work,when the people
don't write in all the 3 boxes...
HOW CAN I DO IT?
THKS
DIANA