2
I was looking for a function to display an alert message to the user when he leaves the page and I located this one on 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 to make this alert not run when I perform a Submit?
The problem is happening because the system I am developing is performing a refresh on the ai page when clicking the button that sends the data the browser is displaying the message
Complementing the Post.... Look at the image, the warning message is displayed when I click on "change" I wanted it not to be displayed when I clicked on that button
missed you put the message in the question
– rLinhares
What message? Make submission through
isset($_POST)
? That phrase made no sense. Make the alert not run? What do you mean? Overall, your question made no sense. You can [Dit] and try to improve it by better describing the problem?– Woss
complemented with an image! is displayed an alert in the browser..
– Diego Lela
create a Boolean, and only run the Alert function if that Boolean is true or false depends on its logic
– Anderson Henrique