The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Dropdown Hidden Value
I have a tricky situation that I'm trying to solve on a calculator form. I'd like to create different math based on what is selected from a dropdown. Example:
[dropdown select options]
CHOCOLATE (hidden value of 4)
VANILLA (hidden value of 3)
CHERRY (hidden value of 2)
Does anyone know if it's possible to make different dropdown options hold a numerical value? I need different values to hold a different number value so that if they select chocolate, the calculator I'm using knows that means they get 4 items. It's a number based on weight, which is why I need to determine what flavor is selected. Kind of a weird request but I'm struggling figuring out how to do this with Formidable unless I just custom code an entire form with javascript and if/else statements. Any suggestions would be appreciated!
November 29, 2017 at 11:03 am
Just select "use separate values" for the dropdown. You can make the values anything you want.
November 29, 2017 at 11:14 am
Formidable requires the separate values to be different from each other, though. I know I have different "flavors" that will have the same numerical value and it won't allow for duplicates. It seems that this is used more for labeling then actually putting a numerical value to be used for math calculations. But maybe I'm missing something?
November 29, 2017 at 11:34 am
If you use the bulk editor, you can save same values.
November 29, 2017 at 12:19 pm
Victor, you are right. I was able to bulk edit. Thanks
The big question is how do you reference that separate field for doing math calculations? I know if my dropdown field id is 350, I can use that value to display a value (like 20 * [350]). I couldn't find any documentation on whether the numerical value from a separate field can be used for calculations.
November 29, 2017 at 12:37 pm
Truthfully, if I were doing this, I would do the calculation in jQuery. I've never liked Formidable's way of doing calculations. Some of the forms I've had to build in the past have highly complex calculations. I just automatically go to jQuery now and don't bother with Formidable's calculations. Same holds true for real time field validation.
November 29, 2017 at 12:53 pm
In case anyone else references this post later on, just using the dropdown field's ID WILL work for doing math calculations if you put a number in the separate field. I'm surprised it worked, but it works so I'm just glad.
Victor, thanks for your input!
Discussion closed.