Title: Complex calculation logic for forms
Last modified: March 6, 2024

---

# Complex calculation logic for forms

 *  Resolved [lilingg](https://wordpress.org/support/users/lilingg/)
 * (@lilingg)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/complex-calculation-logic-for-forms/)
 * I am building a long form where it’ll be split into 2 sections, the first section
   will be the form and the second section will be the order summary. The form will
   consist of multiple radio buttons/checkboxes where each of the button is supposed
   to have 2 values, weight and cost, and both of these values will need to be displayed
   in the order summary as an individual item as well as used for calculation of
   the total weight and total cost. How do I achieve this since in the plugin each
   radio button is only allowed 1 value?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/complex-calculation-logic-for-forms/#post-17479965)
 * Hi [@lilingg](https://wordpress.org/support/users/lilingg/)
 * I hope you are doing well today.
 * It seems you will need to rely on checkboxes only. Please note radio buttons 
   are not limited by Forminator but by HTML. Can you share with us more details
   and share some examples of your goal so that we can be on the same page and suggest
   what will be the best option for you?
 * Kind Regards,
   Kris
 *  Thread Starter [lilingg](https://wordpress.org/support/users/lilingg/)
 * (@lilingg)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/complex-calculation-logic-for-forms/#post-17480522)
 * Thanks for the swift response, so basically the page that I’ll build will have
   2 sections side by side, the form on the left and the order summary on the right.
 * In the form we have many item groups, each group will have a list of checkboxes,
   and each checkbox will show the item. I want each checkbox to have 2 values, 
   cost and weight, both of these values will be used to calculate the total cost
   and the total weight of the entire form and the totals will be displayed in the
   order summary. Whenever an item is selected, it’ll be displayed as an individual
   item along with its price in the order summary as well.
 * I was just wondering whether there’s a workaround to have 2 values in a radio
   button/checkbox, I was thinking maybe we can add a data attribute for both of
   these elements so that I can access these values programmatically? What would
   you suggest?
 * Thanks again.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/complex-calculation-logic-for-forms/#post-17486366)
 * Hi [@lilingg](https://wordpress.org/support/users/lilingg/)
 * Thank you for the explanation:
 * > How do I achieve this since in the plugin each radio button is only allowed
   > 1 value?
 * This is how are supposed to work, one value for one selected item, you can use
   a checkbox which allows multiple selections but also one value per selection,
   however, it allows you to control better your visibility rules.
 * A workaround here, if the values are fixed, is to use conditionals in the calculation
   field and show / hide the specific calculation when the radio/checkbox option
   is selected, but this becomes a bit tricky depending on the form size.
 * Would it be possible to export your current form [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export)
   and share it using pastebin.com or Google drive?
 * Best Regards
    Patrick Freitas
 *  Plugin Support [Williams – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport3/)
 * (@wpmudevsupport3)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/complex-calculation-logic-for-forms/#post-17507176)
 * Hi [@lilingg](https://wordpress.org/support/users/lilingg/),
 * We haven’t heard from you in a while, I’ll go and mark this thread as resolved.
   Note that you can still reply on this topic.
 * If you have any additional questions or require further help, please let us know!
 * Best regards,
    Laura

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Complex calculation logic for forms’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 4 replies
 * 4 participants
 * Last reply from: [Williams – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport3/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/complex-calculation-logic-for-forms/#post-17507176)
 * Status: resolved