0
function genererListe() {
    // Récupère le ID du tournoi sélectionné
    var idTournoi = document.getElementById("tournois").value.split(":")[0];
    document.getElementById("idTournoiTemp1").value = idTournoi;
    //Requête AJAX pour générer la liste des futures équipes

 document.getElementById("joueurs").innerHTML= <?php echo $dropDownJoueur->getHtmlWithParam(179);?>

    faireRequeteGenerationListeFormation(idTournoi);
}

Sorry my code is in french but here's the context. I want to put the variable idTournoi instead of the 179 that I have right now. everything works in my code except when i want to plug my JS variable. Thank you for your help

Franck
  • 1
  • 1
    It doesn't work like that; JS and PHP code doesn't run at the same time: [What is the difference between client-side and server-side programming?](https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) –  Apr 08 '21 at 20:46
  • You will have to make an Ajax of Fetch Request to the server. – epascarello Apr 08 '21 at 20:58
  • Yeah, that's what I was afraid of. We have to change the whole thing that the team before us had setuped. Thank you for you help! – Franck Apr 08 '21 at 21:04

0 Answers0