13aa6b5e8555 — Gustavo Andres Morero 6 years ago
updating js snippet function to be unique.
1 files changed, 3 insertions(+), 5 deletions(-)

M form_guard/templates/form_guard/js_snippet.html
M form_guard/templates/form_guard/js_snippet.html +3 -5
@@ 1,5 1,5 @@ 
 <script type="text/javascript">
-  var antiSpam = function() {
+  var anti_spam_{{ FORM_GUARD_FIELD_ID }} = function() {
       if (document.getElementById("{{ FORM_GUARD_FIELD_ID }}")) {
           a = document.getElementById("{{ FORM_GUARD_FIELD_ID }}");
           if (isNaN(a.value) == true) {

          
@@ 8,9 8,7 @@ 
               a.value = parseInt(a.value) + 1;
           }
       }
-      setTimeout("antiSpam()", 1000);
+      setTimeout("anti_spam_{{ FORM_GUARD_FIELD_ID }}()", 1000);
   }
-  $(document).ready(function(){
-      antiSpam();
-  });
+  anti_spam_{{ FORM_GUARD_FIELD_ID }}();
 </script>