Skip to content

Instantly share code, notes, and snippets.

@elgrim312
Created October 3, 2017 15:06
Show Gist options
  • Save elgrim312/ffccc2c5fd3faf2a22699ae94518a8cc to your computer and use it in GitHub Desktop.
Save elgrim312/ffccc2c5fd3faf2a22699ae94518a8cc to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action="">
<label for="name">Prénom</label>
<input type="text" id="name" class="input" onkeyup="Isempty()">
<label for="surname">Nom</label>
<input type="text" id="surname" onkeyup="Isempty()">
<input type="submit" disabled id="submit">
</form>
<script type="application/javascript">
function Isempty() {
var name = document.getElementById("name");
var firstname = document.getElementById("surname");
var submit = document.getElementById("submit");
if (name.value !== "" && firstname.value !== "") {
submit.removeAttribute("disabled");
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment