1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <html>
<head>
<script language="JavaScript">
function verifForm(theForm) {
var formValid = true;
if( theForm.unChamp.value == "" ) {
alert("Coucou, y a un blème !");
formValid = false;
}
else if ( /* Ici test d'un autre champ */ ) {
// etc
}
// etc
return formValid;
}
</script>
</head>
<form name="myForm" action="unePage.php" method="POST" onSubmit="return verifForm(this);">
<input type="text" name="unChamp">
<input type="text" name="unChamp2">
<input type="text" name="unChamp3">
</form>
</html> |
Partager