Aide html.twig

Résolu/Fermé
dev_82 Messages postés 45 Date d'inscription mercredi 24 juillet 2019 Statut Membre Dernière intervention 14 mai 2020 - Modifié le 24 juil. 2019 à 22:49
dev_82 Messages postés 45 Date d'inscription mercredi 24 juillet 2019 Statut Membre Dernière intervention 14 mai 2020 - 26 juil. 2019 à 08:11
Bonjour,
Je cherche à supprimer des comptes en cliquant sur un bouton qui est lié au compte en question.
Hors, lorsque je clique sur un compte cela concerne toujours le 1er compte de la liste et j'ai beau cherché d'où peut venir le problème je ne trouve pas car il n'y a que pour la colonne "supprimer" qui a ce problème.
En effet, je récupère les données du tableau avec une boucle for en TWIG.
Le reste marche très bien mis à part la fonctionnalité supprimer mais ce n'est pas un problème lié à du HTML (je crois).
Voilà le code :
<table id="customers" style="margin-top:40px;width:95% !important;margin-left:auto;margin-right:auto;">

  <!-- 1ere ligne du tableau -->
  <tr>
   <th>Nom</th>
   <th>Prenom</th>
   <th>Adresse email</th>
   <th>Statut</th>
   <th>Identification</th>
   <th>Modifier</th>
   <th>Supprimer</th>
  </tr>
  {% for t_authentification in pagination %}
  <tr>
   <td>{{ t_authentification.nom }}</td>
   <td>{{ t_authentification.prenom }}</td>
   <td>{{ t_authentification.email }}</td>
   <td>{{ t_authentification.statut }}</td>        
   <td>Cerbère</td>
   <td><a href="{{ path('compte_nb', {'id' : t_authentification.id}) }}"><img src="{{ asset('img/edit.png') }}" title="Modifier"></a></td>
   <td><a class="btn btn-danger" href="#confirm/id={{t_authentification.id}}" onclick="DeleteAccount();"><img src="{{ asset('img/del.png') }}" title="Supprimer"></a>
    <div id="confirm" hidden style="margin-left:7px;margin-top:5px">
            <h6 style="margin-left:15px;margin-bottom:15px">Voulez-vous supprimer {{ (t_authentification.nom) }} {{ (t_authentification.prenom) }} ?</h6>
            <div class="row"> 
                {{ form_start(formSupp) }}    
              <button type="submit" class="btn btn-secondary" style="margin-left:15px;margin-bottom:15px"><i class="fas fa-check-circle"></i>Supprimer</button>
                {{ form_end(formSupp) }}
             <button class="btn btn-secondary" onclick="AbortDelete();" style="margin-left:15px;margin-bottom:15px"><i class="fas fa-times-circle"></i> Annuler</button>
         </div>
    </div>
  </tr>
  {% endfor %}
</table><


EDIT : Correction des balises de code pour y ajouter la coloration syntaxique.
Explications disponibles ici : https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code


Sauriez-vous m'aider ? svp

9 réponses

jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 4 650
24 juil. 2019 à 22:51
Bonjour,

La suppression.. visiblement... se gère dans la fonction javascript
onclick="DeleteAccount();">

Donc.. sans voir le code concerné... impossible de te répondre.

NB: Pour poster ton code, merci de le faire en utilisant les BALISES DE CODE ... ET en indiquant le langage afin d'avoir la coloration syntaxique.

NB² : Merci de ne pas ouvrir 50 fois la même discussion en doublon sur le forum.

0