Advertisement
PowerQuest

suitecrm script webform

Jun 1st, 2021
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.        function submit_form() {
  3.         if (typeof(validateCaptchaAndSubmit) != 'undefined') {
  4.             validateCaptchaAndSubmit();
  5.         } else {
  6.             check_webtolead_fields();
  7.             //document.WebToLeadForm.submit();
  8.         }
  9.     }
  10.  
  11.     function check_webtolead_fields() {
  12.         if (document.getElementById('bool_id') != null) {
  13.             var reqs = document.getElementById('bool_id').value;
  14.             bools = reqs.substring(0, reqs.lastIndexOf(';'));
  15.             var bool_fields = new Array();
  16.             var bool_fields = bools.split(';');
  17.             nbr_fields = bool_fields.length;
  18.             for (var i = 0; i < nbr_fields; i++) {
  19.                 if (document.getElementById(bool_fields[i]).value == 'on') {
  20.                     document.getElementById(bool_fields[i]).value = 1;
  21.                 } else {
  22.                     document.getElementById(bool_fields[i]).value = 0;
  23.                 }
  24.             }
  25.         }
  26.     }
  27. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement