Skip to content

Instantly share code, notes, and snippets.

@Blacksly
Created April 16, 2014 18:09
Show Gist options
  • Save Blacksly/10915222 to your computer and use it in GitHub Desktop.
Save Blacksly/10915222 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css"/>
<title>Accueil</title>
</head>
<body>
<header>
<h1>Bienvenue sur le serveur de Blacksly !</h1>
</header>
<aside>
<form id="formulaire2" method="post" action="" >
<p> Nom <input type="text" name="nom" id="nom" size="20" maxlength="30"/> </p>
<p> Mot de passe : <br/> <input type="password" id="mdp" name="mdp" size="8" maxlength="8"/> </p>
<input type="button" value="OK" onclick="fonction()" />
</form>
</aside>
<script>
function fonction()
{
if(document.getElementById('nom').value=="" || document.getElementById('mdp').value=="")
{
alert("1 ou plusieurs champs non renseigne");
}
else
{
document.getElementById('formulaire2').submit();
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment