• Resolved veroak26

    (@veroak26)


    Hi! im trying to create a form that will draw a particular result depending on the selected options. Not directly a calculator.

    Front end should look like this:

    r/WordpressPlugins - Calculation plugin help

    first 2 fields are dropdown menus.

    And then the submit should provide a number (3rd column on the img below). The number is not technically a calculation, is just the result of the combination of the options from the dropdown menu options.

    r/WordpressPlugins - Calculation plugin help

    I havent figured out the combination of settings and/or know if its even possible at all with the vanilla version.

    Any tips/ideas?

    TSMIA

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @veroak26

    Thank you very much for using our plugin. Yes, you can implement the project with our plugin.

    There are multiple implementation alternatives. One of them is using conditional statements.

    Assuming the first dropdown is the fieldname1 and fieldname2 is the second dropdown. You can insert a calculated field in the form and enter the following equation through its “Set equation” attribute:

    (function(){
    var a = fieldname1, b = fieldname2;
    
    if(AND(a == 'Option 1', b == 'x')) return 286;
    if(AND(a == 'Option 1', b == 'y')) return 187;
    if(AND(a == 'Option 1', b == 'z')) return 547;
    
    if(AND(a == 'Option 2', b == 'a')) return 1547;
    if(AND(a == 'Option 2', b == 'b')) return 6455;
    if(AND(a == 'Option 2', b == 'c')) return 54;
    
    if(AND(a == 'Option 3', b == 'l')) return 45;
    if(AND(a == 'Option 3', b == 'm')) return 56969;
    if(AND(a == 'Option 3', b == 'n')) return 654;
    })()

    To distribute the fields in columns you can use a DIV field and select the number of columns through its settings:

    https://youtu.be/5wguFUR4pD8

    Or you can assign some predefined class names directly to the fields:

    https://youtu.be/G8Of-V49pAQ

    Learn more about distributing the fields in columns by reading the following blog post:

    https://cff.dwbooster.com/blog/2019/01/06/columns

    Best regards.

    Thread Starter veroak26

    (@veroak26)

    This worked perfectly. Thanks so much!

    What if I want to have the results to appear on a new page?

    Right now the calcultion is happening real-time when i select my choices, how can i make them appear on a new page?

    Also, the result number hsould be a currency. I selected that option and added the euro symbol, but now the form is not displaying my result :S

    Plugin Author codepeople

    (@codepeople)

    Hello @veroak26

    To display the result as a currency, you can enter the currency symbol into the “Symbol to display at the beginning of calculated field” or “Symbol to display at the end of the calculated field” attributes in the calculated field’s settings, and tick the “it is a currency” checkbox.

    To display the results on another page, you should tick the “Hide Field From Public Page” checkbox in the calculated field settings, enter the URL to the new page into the “Thank you page” attribute in the form’s settings, and finally, insert the shortcode for results in the content of the thank you page.

    https://cff.dwbooster.com/documentation#thanks-page

    Best regards.

    Thread Starter veroak26

    (@veroak26)

    oh i think i need to have a paid plan to choose a thank you page :S

    Plugin Author codepeople

    (@codepeople)

    Hello @veroak26

    Yes, unfortunately the shortcode for results is a commercial feature.

    For pro or commercial product support please contact us directly on our site. This includes any pre-sales topics as well.

    Commercial products are not supported in these forums. We will happily answer this and any other questions you can have on our own site.

    Thank you.

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

The topic ‘Calculation issue’ is closed to new replies.