Vérification de remplissage du formulaire

Bonjour,
svp corrigez ce code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>

<script type="text/javascript">
function verif_champ(id)
{
if (id == "")
{ alert("Le champ id n'est pas remplie");
return false;
}
return true;
}
</script>
<script type="text/javascript">
function verif_champ(nom)
{
if (nom == "")
{ alert("Le champ nom n'est pas remplie");
return false;
}
return true;
}
</script>
<script type="text/javascript">
function verif_champ(prenom)
{
if (prenom == "")
{ alert("Le champ prénom n'est pas remplie");
return false;
}
return true;
}
</script>
</head>

<body>

<form name='form1' onsubmit='returnverif_champ(document.form1.id.value);'action="inscription.php" method="post">

<form name='form1' onsubmit='returnverif_champ(document.form1.nom.value);'action="inscription.php" method="post">

<form name='form1' onsubmit='returnverif_champ(document.form1.prenom.value);'action="inscription.php" method="post">

<p>
<label for="pseudo">ID</label> :<input type="text" name="id" id="id" size="20"/><br />
<label for="name">Nom</label> :<input type="text" name="nom" id="nom" size="20"/><br />
<label for="prenom">Prenom</label> :<input type="text" name="prenom" id="prenom" size="20"/><br/>

<input type="submit" value="Valider"/>
</p>
</form>
</body>
</html>

1 réponse

  1. svp corrigez ce code 
    

    Non personne te le corrigera tant que tu parlera comme ca, sans avoir plus d'explication et sans respecter les règles du forums : les balises code ne sont pas la pour faire jolies.
    0