WordPress.org

Forums

Calculated Fields Form
[resolved] Add Conditionals to Checkboxes (7 posts)

  1. Andrea Reed
    Member
    Posted 1 year ago #

    My client wants the option to have her services listed in checkboxes with each assigned a value, then a field that is # of weeks with the total being # of weeks x all services. This works already very well. However now, the client wants to be able to have the option for each checkbox to specify number of weeks and have that override the initial # of weeks field. Is this possible?

    For example:

    (field 1) ____ Number of Weeks

    (field 2) Checkboxes of Services
    _ Service 1 ($100)
    _ Service 2 ($100)
    etc..

    (field 3) Total is field 1 x field 2.

    Modified to be:

    (field 1) ____ Number of Weeks

    (field 2) Checkboxes of Services
    _ Service 1 ($100) [additional # of weeks box here]
    _ Service 2 ($100) [additional # of weeks box here]
    etc..

    (field 3) Total is field 1 x field 2. Or if additional box has a value, then that Service x additional field.

    Thanks!

    https://wordpress.org/plugins/calculated-fields-form/

  2. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    If each service can have associated a week field, the equation would be more complex. First, each service should be represented by a different field (and not different options of the same field). For example, if the fields are:

    fieldname1 number of weeks
    fieldname2 first service
    fieldname3 second service
    fieldname4 number of weeks for fieldname2
    fieldname5 number of weeks for fieldname3

    Now the equation would be:

    fieldname1*(((fieldname4)?fieldname2*fieldname4:fieldname2)+((fieldname5)?fieldname3*fieldname5:fieldname3))

    Best regards.

  3. Andrea Reed
    Member
    Posted 1 year ago #

    Thanks! But this would not be inline would it? Number of weeks would be above the first service? Any way around this? Thank you!

  4. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    If you want to display the fields inline (like a grid), use the special classnames: column2, column3, column4.

    If you assign the class name "column2" to two consecutive fields in form, the fields will be displayed one beside the other.

    If you assign the class name "column3" to three consecutive fields in form, the fields will be displayed one beside the other, and the same occurs with column4 and four consecutive fields.

    More information in the following FAQ entry:

    http://wordpress.dwbooster.com/faq/calculated-fields-form#q66

    Best regards.

  5. Andrea Reed
    Member
    Posted 1 year ago #

    Amazing! Works great! Thanks.

    One further question: Is it easy to style so the inline fields are closer together?

    Please see example here, at the very bottom. Thanks!

    http://tulsaholistichealth.com/test/

  6. Andrea Reed
    Member
    Posted 1 year ago #

    Apologies, you will see on the link that the inline fields have moved, under the header of Weekly Services. Thanks!

  7. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    In this case I recommend you create your own class names, in place of the predefined "column2". For example:

    Add to the first element in the row the class name columnA, and the second one the class name columnB, and then in any of the styles files in your website, define both classes like follow:

    .columnA{
    float: left;
    width: 30%;
    }

    .columnB{
    float: left;
    width: 69.8%;
    }

    Note: It is recommended to clear the browsers cache after modify the online files.

    Best regards.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Calculated Fields Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic