Title: toggle switch with 2 values?
Last modified: June 4, 2024

---

# toggle switch with 2 values?

 *  Resolved [sloganwp](https://wordpress.org/support/users/sloganwp/)
 * (@sloganwp)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/)
 * Hello all,
 * I would like to allow the user to shoose between “annual fee” or “monthly fee”
   with a single switch.
 * Switch on: value1
   Switch off: values2
 * How can I do this with a single field? I tried radio button but it requires two
   radio buttons instead of a single one.
 * TIA
 * tony

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17800905)
 * Hello [@sloganwp](https://wordpress.org/support/users/sloganwp/)
 * Thank you very much for using our plugin. The value of the unticked checkbox (
   or switch off) is zero. So, you can insert a checkbox field with only one choice
   and enter the number 1 as its value. In the equation implementation, you can 
   consider the field value 1 as the annual fee, and the monthly fee otherwise.
 * For example, assuming you have the equation fieldname1+fieldname2, and the fieldname3
   is the checkbox field. If the user ticks it (its value is one, annual fee) you
   want to increase the sum twelve times. The hypothetical equation could be implemented
   as follows:
 *     ```wp-block-code
       SUM(fieldname1, fieldname2)*IF(fieldname3, 12, 1)
       ```
   
 * Best regards.
 *  Thread Starter [sloganwp](https://wordpress.org/support/users/sloganwp/)
 * (@sloganwp)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17800940)
 * Thanks for your reply. I would like to create something like this:
 * [[
 * [https://dribbble.com/shots/21873624-Which-plan-will-you-choose-for-yourself](https://dribbble.com/shots/21873624-Which-plan-will-you-choose-for-yourself)
 * Can I do this with CCF?
 * TIA
    -  This reply was modified 1 year, 11 months ago by [sloganwp](https://wordpress.org/support/users/sloganwp/).
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17801202)
 * Hello [@sloganwp](https://wordpress.org/support/users/sloganwp/)
 * Yes, that’s possible. The plugin includes the “Customize Form Design” attribute
   in the “Form Settings” tab. It is a CSS editor with syntax highlighting and error
   checking. You can assign a custom class name to the field you want to modify,
   and personalize the field appearance as needed. Please watch the video by visiting
   the following link:
 * [https://resources.developers4web.com/cff/tmp/2024/06/04/video_o.mp4](https://resources.developers4web.com/cff/tmp/2024/06/04/video_o.mp4)
 * If you need a custom coding service to personalize the appearance of your control,
   please contact us directly through the plugin website. [Contact Us](https://cff.dwbooster.com/customization)
 * Best regards.
 *  Thread Starter [sloganwp](https://wordpress.org/support/users/sloganwp/)
 * (@sloganwp)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17801763)
 * Thanks.
 * So, basically, I set a radio field with two choices and style them using css.
   Is this correct?
 * TIA
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17801785)
 * Hello [@sloganwp](https://wordpress.org/support/users/sloganwp/),
 * Not really, it is only one radio button choice with two status modified via CSS.
 * Best regards.
 *  Thread Starter [sloganwp](https://wordpress.org/support/users/sloganwp/)
 * (@sloganwp)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17801896)
 * Actually I have two choices. When I select choice1 I get is value and a new fieldset
   is displayed. When I select choice2 I get only the choice2 value.
 * Is there a way to get the same result? 
   i.e.: when the switch is YEARLY the new
   fieldset is displayed and values is choice1. when the switch is MONTHLY the values
   is choice2. TIA
 * tony
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17801922)
 * Hello [@sloganwp](https://wordpress.org/support/users/sloganwp/)
 * I’m sorry, but I don’t understand your question.
 * You can configure fields depending on the radio button choices. The dependent
   fields will be visible and active only when the choice is ticked:
 * [https://cff.dwbooster.com/blog/2020/03/01/dependencies](https://cff.dwbooster.com/blog/2020/03/01/dependencies)
 * Furthermore, you can associate a different value to each choice you can use in
   the equations by using conditional statements or conditional operations as I 
   did in a previous entry.
 *     ```wp-block-code
       SUM(fieldname1, fieldname2)*IF(fieldname3, 12, 1)
       ```
   
 * Best regards.

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

The topic ‘toggle switch with 2 values?’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/toggle-switch-with-2-values/#post-17801922)
 * Status: resolved