• Resolved escootie

    (@escootie)


    Hi.I’m trying to make calculator where option selected from dropdown will show custom result. So its not any standard formula. Its just like selected option A is showing as result option 1 and option B is also showing option ! but option C is showing option 3 and option D is showing option 4. I’m not sure how to do it..

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

    (@codepeople)

    Hello @escootie

    A simple alternative would be to insert different fields with the possible results, and define them as dependent on the choices in the DropDown field. More information about dependencies, reading the following post in the plugin’s blog:

    https://cff.dwbooster.com/blog/2020/03/01/dependencies/

    Best regards.

    Thread Starter escootie

    (@escootie)

    Thank you for your reply. This is helping a bit but I need for selected option to show number. I can probably get pictures of numbers and add it that way but instead of image is it possible to display text or numbers?

    Regards Robi

    Thread Starter escootie

    (@escootie)

    Just to explain what I’m trying to do. So I’m making tyre pressure calculator for 2 wheeler where there is different value for each wheel depending on riders weight.

    Plugin Author codepeople

    (@codepeople)

    Hello @escootie

    I don’t understand what do you mean with pictures, the dependent fields are not limited to pictures. You can define any field in the form as dependent: number fields, single-line text fields, other dropdown fields, etc.

    Another alternative would be to display the result in a calculated field using conditional statements. I’ll try to describe the process with a hypothetical example:

    Assuming there is a dropdown field (fieldname1) with three choices: A, B, C, and you want to return the number 123 if the user selects the “A” choice, the number 456 if the user selects the B choice, and the number 789 if the user selects the C choice.

    Note, the field’s name, choices and numbers are hypothetical, only to describe the process.

    Insert a calculated field in the form with the equation:

    
    (function(){
    if(fieldname1 == 'A') return 123;
    if(fieldname1 == 'B') return 456;
    if(fieldname1 == 'C') return 789;
    })()
    

    Best regards.

    Thread Starter escootie

    (@escootie)

    Everything is working perfect now. thank you so much.

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

The topic ‘Selected option showing custom result’ is closed to new replies.