Title: Performing calculation on form elements
Last modified: November 19, 2019

---

# Performing calculation on form elements

 *  [Steve Greenham](https://wordpress.org/support/users/stevegrr/)
 * (@stevegrr)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/performing-calculation-on-form-elements/)
 * I’m using CF7 for members of our sailing club to renew their membership. The 
   problem I have is there are different types of membership, with different fees,
   and then various discounts as well.
 * What I would like to be able to do is capture the details of the membership they
   require and discounts they are eligible for on the form and then calculate their
   fee to include in the email I generate back to them.
 * I know how to do the calculation with PHP and if I was using a native HTML form
   I would be able to do the calculation as part of the submit and then include 
   the answer in the email I generate.
 * Wordpress won’t allow me to embed php, but I have managed to use a Shortcode 
   on the page, with the relevant code in the theme’s functions.php. The missing
   piece is I can’t see a way to link the fields returned from the CF7 form to the
   shortcode.
 * Simple example: the Adult fee is $110. If the user has clicked the “Under 25”
   checkbox, subtract $50 from the fee.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fperforming-calculation-on-form-elements%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Performing calculation on form elements’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Steve Greenham](https://wordpress.org/support/users/stevegrr/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/performing-calculation-on-form-elements/)
 * Status: not resolved