First off, I am a developer for Cognito Forms.
Just to clarify, you want to show a set of checkboxes, with assigned prices, and calculate the amounts as a total for the form, something like this:
If you want to manually calculate a total based on the selections, you can use the following calculation (which is tricky, btw):
=Choice.Count(it = "First Choice") * 1.00 + Choice.Count(it = "Second Choice") * 2.00 + Choice.Count(it = "Third Choice") * 3.00
However, this is definitely not obvious, nor easy, so we have been working to makes things better. In the next release, which is currently in testing, you can configure choice fields as follows:
By selecting Collect Payment For This Field, you can then specify prices for each choice. These selections automatically add to the amount due and optionally can appear as separate order line items. This release will also support tightly integrated Stripe payment, so the order form example above would become:
Hopefully, these changes will support your needs and make things much easier!
I am a developer for Cognito Forms
- We do not have a way to auto format a field or change entered text from "123A5B78901E" to "12:3A:5B:78:90:1E". However you can use a calculation and pull the information entered into a text field over into a calculation field that will format the text for you. This will not validate the text though. In order to do this start with a Text field and then create a Calculation field just under it. You can then place this calculation into the Calculation field. In this example I am targeting the Text field titled "Text Field". This calculation will place a colon after every 2 items in the string. It wont change the Text field but the new calculation field will show the formated entry.
=TextField.Substring(0,2) +":"+ TextField.Substring(2,2) +":"+ TextField.Substring(4,2) +":"+ TextField.Substring(6,2) +":"+
TextField.Substring(8,2) +":"+ TextField.Substring(10,2)
- If you want the number to be generated in a field that users cant edit I would recommend using a Calculation Field. This will show users the number and allow you to use the number in other calculations. You will need to set the "Type" of this Calculation field to "Numbers". You can then use this calculation to reference your choice field and assign numbers based on the selected drop down option. In this example I have used "Choice" as the Choice field title and then First, Second, and Third as each choice option. I have then assigned a number to each option First = 10, Second = 20, and Third = 30. If nothing is selected then 0 will be placed in the Calculation field.
=Choice = "First Choice" ? 10 : Choice = "Second Choice" ? 20 : Choice = "Third Choice" ? 30 : 0
Best Answer
Calculations in Cognito Forms can reference all fields and perform just about any calculation you can think of.
In this example, if you have a
Choice
field calledDiscount
and aCurrency
field calledAmount
, you would enter the following calculation for the discount amount:=(if Discount = "3%" then 0.03 else 0) * Amount