Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bypass refresh behavior of Firefox

How do you capture refresh button or event of Firefox browser using Javascript and imitate the behavior of IE when refreshing forms? Firefox refills the forms which destroys my ajax UI.

like image 587
Aivan Monceller Avatar asked Nov 06 '22 05:11

Aivan Monceller


2 Answers

I'm not sure how IE behaves, but if you just want the form to be empty before your ajax UI does its work, you can clear the form as it reloads by using window.beforeunload.

like image 185
syockit Avatar answered Nov 12 '22 21:11

syockit


<form name="form1" id="form1" method="post" autocomplete="off" action="http://www.example.com">
</form>

https://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion

like image 22
Aivan Monceller Avatar answered Nov 12 '22 19:11

Aivan Monceller