2
I’m trying to make a button that only sends the form when I click on OK, but this one of mine, even though I click on Cancel, is being sent.
Javascript:
<script language="JavaScript">
function pergunta(){
if (confirm('Tem certeza que quer enviar este pedido?')){
document.enviarform.submit()
}
}
</script>
Knob:
<form name='apagar' id='apagar' action='formulario.php' method='post'>
<input type=submit value=enviar name=enviarform onclick='pergunta();'>
Where is the error?
Obs: when I put type=button
in place of type=submit
does no action (or sends, or anything).
Obs2: when in place of <input>
place a <button>
, send the same way (without giving the OK).
Anyone can help?
I put... keep sending even when I click cancel...
– Felipe