Master to 4.2.8
[usit-rt.git] / share / static / js / forms.js
CommitLineData
af59614d 1jQuery(function() {
c33a4027
MKG
2 // reset form submit info when user goes backward or forward for Safari
3 // other browsers don't need this trick and they can work directly.
4 if ( window.addEventListener ) {
5 window.addEventListener("popstate", function(e) {
6 jQuery('form').data('submitted', false);
7 });
8 }
9
10 jQuery('form').submit(function(e) {
11 var form = jQuery(this);
12 if (form.data('submitted') === true) {
13 e.preventDefault();
14 } else {
15 form.data('submitted', true);
16 }
17 });
18});