• Resolved sloganwp

    (@sloganwp)


    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

    (@codepeople)

    Hello @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:

    SUM(fieldname1, fieldname2)*IF(fieldname3, 12, 1)

    Best regards.

    Thread Starter sloganwp

    (@sloganwp)

    Thanks for your reply. I would like to create something like this:

    https://dribbble.com/shots/21873624-Which-plan-will-you-choose-for-yourself

    Can I do this with CCF?

    TIA

    • This reply was modified 9 months ago by sloganwp.
    Plugin Author codepeople

    (@codepeople)

    Hello @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

    If you need a custom coding service to personalize the appearance of your control, please contact us directly through the plugin website. Contact Us

    Best regards.

    Thread Starter sloganwp

    (@sloganwp)

    Thanks.

    So, basically, I set a radio field with two choices and style them using css. Is this correct?

    TIA

    Plugin Author codepeople

    (@codepeople)

    Hello @sloganwp,

    Not really, it is only one radio button choice with two status modified via CSS.

    Best regards.

    Thread Starter sloganwp

    (@sloganwp)

    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

    (@codepeople)

    Hello @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

    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.

    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.