Commit 74ea971ecf824fb743edfd85872a107bedceff02
1 parent
e4f5453d
jQuery request style
Removed issue with on-all-dom mouseup event listener Added partial implementation of creds validation
Showing
1 changed file
with
15 additions
and
11 deletions
Show diff stats
connect.php
1 | <h2> Connexion </h2> | 1 | <h2> Connexion </h2> |
2 | - | ||
3 | -<form class="form-horizontal" role="form"> | ||
4 | - | 2 | +<form class="form-horizontal" role="form"> |
5 | <div class="form-group"> | 3 | <div class="form-group"> |
6 | <label for="entrer_Identifiant_3" class="col-sm-2 control-label">Identifiant</label> | 4 | <label for="entrer_Identifiant_3" class="col-sm-2 control-label">Identifiant</label> |
7 | <div class="col-sm-10"> | 5 | <div class="col-sm-10"> |
8 | <input type="identifiant" class="form-control" id="Entrer_Identifiant_3" placeholder="Votre identifiant"> | 6 | <input type="identifiant" class="form-control" id="Entrer_Identifiant_3" placeholder="Votre identifiant"> |
9 | </div> | 7 | </div> |
10 | </div> | 8 | </div> |
11 | - | ||
12 | <div class="form-group"> | 9 | <div class="form-group"> |
13 | <label class="col-sm-2 control-label" for="entrer_mot_de_passe_3">Mot de passe</label> | 10 | <label class="col-sm-2 control-label" for="entrer_mot_de_passe_3">Mot de passe</label> |
14 | <div class="col-sm-10"> | 11 | <div class="col-sm-10"> |
@@ -20,7 +17,6 @@ | @@ -20,7 +17,6 @@ | ||
20 | </div> | 17 | </div> |
21 | </div> | 18 | </div> |
22 | </div> | 19 | </div> |
23 | - | ||
24 | <div class="form-group"> | 20 | <div class="form-group"> |
25 | <div class="col-sm-offset-2 col-sm-10"> | 21 | <div class="col-sm-offset-2 col-sm-10"> |
26 | <div class="checkbox"> | 22 | <div class="checkbox"> |
@@ -30,17 +26,25 @@ | @@ -30,17 +26,25 @@ | ||
30 | </div> | 26 | </div> |
31 | </div> | 27 | </div> |
32 | </div> | 28 | </div> |
33 | - | ||
34 | <div class="form-group"> | 29 | <div class="form-group"> |
35 | <div class="col-sm-offset-2 col-sm-10"> | 30 | <div class="col-sm-offset-2 col-sm-10"> |
36 | - <button type="submit" class="btn btn-primary">Se connecter</button> <!-- Il faut ajouter le lien d'identification --> | 31 | + <button id="validCreds" type="submit" class="btn btn-primary">Se connecter</button> |
37 | </div> | 32 | </div> |
38 | </div> | 33 | </div> |
39 | - | ||
40 | </form> | 34 | </form> |
41 | 35 | ||
42 | <script type="text/javascript"> | 36 | <script type="text/javascript"> |
43 | - // Affiche le mot de passe | ||
44 | - document.getElementById('afficherMotDePasse').addEventListener('mousedown', function() {document.getElementById('entrer_mot_de_passe_3').type = 'text'}) | ||
45 | - document.addEventListener('mouseup', function() {document.getElementById('entrer_mot_de_passe_3').type = 'password'}) | 37 | +// Affiche le mot de passe |
38 | +$("#afficherMotDePasse")[0].addEventListener('mousedown', function() | ||
39 | +{ | ||
40 | + $('#entrer_mot_de_passe_3')[0].type = 'text'; | ||
41 | +}); | ||
42 | +$('#afficherMotDePasse').addEventListener('mouseup', function() | ||
43 | +{ | ||
44 | + $('#entrer_mot_de_passe_3')[0].type = 'password'; | ||
45 | +}); | ||
46 | +$('#validCreds')addEventListener('click', function() | ||
47 | +{ | ||
48 | + $("#validCreds")[0].disabled=true; | ||
49 | +}); | ||
46 | </script> | 50 | </script> |