Commit 74ea971ecf824fb743edfd85872a107bedceff02

Authored by Jean Wasilewski
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 1 <h2> Connexion </h2>
2   -
3   -<form class="form-horizontal" role="form">
4   -
  2 +<form class="form-horizontal" role="form">
5 3 <div class="form-group">
6 4 <label for="entrer_Identifiant_3" class="col-sm-2 control-label">Identifiant</label>
7 5 <div class="col-sm-10">
8 6 <input type="identifiant" class="form-control" id="Entrer_Identifiant_3" placeholder="Votre identifiant">
9 7 </div>
10 8 </div>
11   -
12 9 <div class="form-group">
13 10 <label class="col-sm-2 control-label" for="entrer_mot_de_passe_3">Mot de passe</label>
14 11 <div class="col-sm-10">
... ... @@ -20,7 +17,6 @@
20 17 </div>
21 18 </div>
22 19 </div>
23   -
24 20 <div class="form-group">
25 21 <div class="col-sm-offset-2 col-sm-10">
26 22 <div class="checkbox">
... ... @@ -30,17 +26,25 @@
30 26 </div>
31 27 </div>
32 28 </div>
33   -
34 29 <div class="form-group">
35 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 32 </div>
38 33 </div>
39   -
40 34 </form>
41 35  
42 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 50 </script>
... ...