Perte de controle Submit() intempestif
En appuyant sur le bouton "ici" le formulaire est envoyé. Jusque là tout va bien (comme le gars qui est en train de tomber de l'immeuble :lol:).
Par contre je ne comprends pas pourquoi en appuyant sur "la" il est aussi envoyer?
Comment éviter cela?
Merci
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| <html>
<head>
<style>
.divhide{
display: none;
background-color: #F93;
text-align: center;
font-size: 14px;
}
</style>
<script type="text/javascript">
// Masquage ou affichage d'un element
function Show_Hide(objID) {
var obj = document.getElementById(objID);
if (obj.style.display=='block') {
obj.style.display='none';
} else {
obj.style.display='block';
}
}
</script>
</head>
<body>
<form name=f1>
Appuyez
<button onclick="Show_Hide('linka'); document.f1.submit();" onmouseover="this.style.cursor='pointer';">ici</button> sinon
<button onclick="Show_Hide('linkb');">la</button>
<div id=linka class=divhide>Validation de votre présence...</div>
<div id=linkb class=divhide><a href="/Intra/login-V2.php?logout=1&SRC=login-V2.php">Déconnexion</a></div>
</form>
</body>
</html> |