Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. add_action('wpcf7_before_send_mail', 'TotalPrice');
  2.  
  3. (function TotalPrice()
  4. {
  5. //Select checkboxes by id
  6. var $checkboxes = $('input[id=checkboxprice]');
  7. //Set event
  8. $checkboxes.on('change', function ()
  9. {
  10. var totalPrice = 0;
  11. $checkboxes.each(function()
  12. {
  13. //Sum values of checkboxes
  14. if(this.checked)
  15. totalPrice = totalPrice + parseInt(this.value);
  16. });
  17. $("#price").val(totalPrice);
  18. });
  19. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement