1
I have an onClick in an image with 2 requests:
1) a check 2) a redirect
function verifica(Msg) {
return confirm(Msg);
}
And the image:
<img
src="'.$imagemExclui.'"
align="center"
style="height: 40px;"
title="Excluir Produto"
onClick="return verifica(\''.$mensagem.'\');
document.location=\'?acao=remove&indice='.$produto["idProdutos"].'\'"; />
But when I call the function checks, if I withdraw the return
it works, but even if I select yes, it does not follow, if I leave and return
, it doesn’t work.
What to do?
Possible duplicate of http://answall.com/q/88536/129
– Sergio
For this specific case it is also possible to do:
onclick="if(verifica(...)){ document.location=... }
instead ofreturn
.– Woss
Perfect Anderson, that’s what I needed. Thank you!
– Carlos Rocha