Bonjour à tous,
je suis bloquée depuis un moment sur un script en java censé verifié l'adresse -mail du formulaire en affichant une erreur tent que "@" n'est pas présent...
Voilà le script:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Formulaire</title>
<script type="text/javascript">
function verifierchamp(champ)
{
var valeurchamp = document.getElementById(champ).value;
if(valeurchamp == "")
{
document.getElementById(champ).style.border = 'solid #FF3300';
controlformulaire = 0;
}
else
{
document.getElementById(champ).style.border = '';
}
}
function verifierformulaire()
{
var controlformulaire = 1;
verifierchamp('nom');
verifierchamp('prenom');
verifierchamp('demande');
verifierchamp('e-mail');
verifierchamp('telephone');
if(controlformulaire == 1)
{
document.getElementById("formulaire").button();
}
}
</script>
<link rel="stylesheet" href="style1.css" />
</head>
<body>
<div id="header">
<h1>Module 101 - ex1</h1>
</div>
<div id="menu">
<ul class="nav">
<li><a href="formulaire.html">Accéder aux médias</a></li>
<li><a href="formulaire.html">Contacter-nous</a></li>
</ul>
</div>
<div id="content">
<h2>Module 101 Contact</h2>
<form action="formulaire.html" method="GET" id="formulaire">
<table>
<tr>
<td><label for="Titre">Titre</label></td>
<td><select name="sexe">
<option>Homme</option>
<option>Femme</option>
</select><br>
</td>
</tr>
<tr>
<td><label for="nom">Nom</label></td>
<td><input type="text" name="nom" placeholder="Nom" id="nom"><br></td>
</tr>
<tr>
<td><label for="prenom">Prénom</label></td>
<td><input type="text" name="Prénom" placeholder="Prénom" id="prenom"><br></td>
</tr>
<tr>
<td><label for="Demande">Demande</label></td>
<td><textarea id="demande" name="demande" cols="50" rows="5"></textarea><br>
</td>
</tr>
<tr>
<td><label for="E-mail">E-mail</label></td>
<td><input type="email" name="e-mail" placeholder="E-mail" id="e-mail" ><br></td>
</tr>
<tr>
<td><label for="Téléphone">Téléphone</label></td>
<td><input type="text" name="telephone" placeholder="Téléphone" id="telephone"><br></td>
</tr>
<tr>
<td>Répondez moi par téléphone:</td>
<td><input type="radio" name="option"><br></td>
</tr>
<tr>
<td>Répondez moi par e-mail:</td>
<td><input type="radio" name="option"><br></td>
</tr>
<tr>
<td><input type="button" value="Envoyer" onClick="verifierformulaire()"></td>
<td><input type="reset"></td>
</tr>
</table>
</form>
</div>
<div id="footer">
<p>CIE101 - 16.02.2015</p>
</div>
</body>
</html>
Merci d'avance pour de l'aide....
Afficher la suite