Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wpcf7_before_send_mail', 'TotalPrice');
- (function TotalPrice()
- {
- //Select checkboxes by id
- var $checkboxes = $('input[id=checkboxprice]');
- //Set event
- $checkboxes.on('change', function ()
- {
- var totalPrice = 0;
- $checkboxes.each(function()
- {
- //Sum values of checkboxes
- if(this.checked)
- totalPrice = totalPrice + parseInt(this.value);
- });
- $("#price").val(totalPrice);
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement