I was looking for a function to display an alert message to the user when he left the page and located this one in the forum:
<script>
// Script de Alerta ao fechar a pagina...
window.onbeforeunload = fecharJanela
function fecharJanela(){
return "Você realmente deseja sair? os dados não salvos serão perdidos...";
}
</script>
How can I prevent this alert from being executed when I submit a submit?
The problem is happening because the system I am developing is performing a refresh on page ai by clicking the button that sends the data the browser is displaying the message
Complementing the Post .... Look at the image, the alert message is displayed when I click on "change" I wanted it not to be displayed when I clicked this button