J'ai un bouton de type submit qui fait un submit du formulaire et j'aimerai qu'avant le submit, une pop up de confirmation apparaisse.
Voici mon code :
La pop up apparaît bien quand ça submit mais l'annulation ne marche pas...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 <form id="formChercher" method="post" action="list.html"> ... <input type="submit" id="chercher" class="bouton" value="Recherche" name="chercher" /> </form> et le javascript : confirmation = function confirmation() { document.forms["formChercher"].onsubmit = confirm('OK ou annuler'); } addLoadEvent(function() { addEvent("formChercher", 'submit', confirmation); } );
Pouvez-vous m'aider?
Partager