title: Fix jQuery formula
body: <p>I am blocked in a simple jquery calculation and I don't know what to do.</p>
  <pre><code>jQuery(document).ready(function(){
      var totalCost = null;
      var periodNotice = 'Select subscription period';
   jQuery(&quot;#credits&quot;).change(function(){
   var selectedCredit = jQuery(this).val();
   var crm = jQuery(this).children(&quot;option:selected&quot;).text();
   jQuery(&quot;#crm&quot;).val(crm);
   jQuery(&quot;#mcost&quot;).val(selectedCredit);
  
  jQuery(&quot;.calc&quot;).click(function(event) {
      var total = 0;
      jQuery(&quot;.calc:checked&quot;).each(function() {
                      var period = jQuery('.period:checked').val();
                      var mailwizz = jQuery('.mailwizz:checked').val();
          total = parseInt(jQuery(mcost).val()) * parseInt(jQuery(period).val()) + parseInt(jQuery(mailwizz).val());
  
      });
      
      if (total == 0) {
          jQuery('#tcost').val('');
      } else {                
          jQuery('#tcost').val(total);
      }
  });
  });
  });
  </code></pre>
  <p><a href="https://i.stack.imgur.com/xrWTz.png" rel="nofollow noreferrer">myform</a></p>
  <p>The formula is MONTHLY COST * SUBSCRIPTION PERIOD (1 OR 12) + MAILWIZZ CHECKBOX (0 or 88)</p>
  <p>Thank you in advance!</p>