You are here

README.txt in Webform Calculation Components 7

Same filename and directory in other branches
  1. 7.2 README.txt
Webform Calculation Components
******************************

This module provides AJAX functionality to perform basic arithmetic operations
on webform components.

With this module the user can have calculated fields, e.g. the total amount,
calculated percentage etc.
This module provides two new component types:

Webform Calculation Number (Calculation - number)

That component is a numeric field where the user can type a number. The target
field (result field) is set when configuring the Webform Calculation Number
component.
When the webform is displayed, the user can enter numbers in these fields and
the calculation is performed against the result field.

Webform Calculation Hidden (Calculation - hidden)

It can be used to perform operations with existing numeric components.
The calculation is triggered when the user select a specific option in
checkboxes, radio button or select option.
All that is configured when creating the Webform calculation hidden component.
It is possible to perform one operation e.g. Addition to several numeric
fields, then the result will be calculated against the result number component.
Note that select field choices must be selected, (they can be more than one)
and they have to correspond to the select field that triggers the calculation.

The available operations are the following:

[addition]
[subtraction]
[multiplication]
[division]
[percentage]
[modulo]

Configuration:

For Webform Calculation Number

Go to add content > webform (or any webform content type):
- Create a new webform
- Create new webform components, you need at least one numeric component to be
selected as the result field.
- Create a new Calculation - number component.
- Select the arithmetic operation and the result field.
- Optionally the number of decimals can be configured.
- Configure the rest of options like a normal webform component.

For Webform Calculation hidden

Go to add content > webform:
- Create a new webform
- Create new webform components, you need at least two numeric and a select
component.
- Create a new Calculation - hidden component.
- Select the operand field. It has to be one or more of the numeric fields
created previously.
Hold Control key to select more than one.
- Select the arithmetic operation and the result field.
- Select the select field (created previously).
- Select the select field choices. The choices must coincide with the chosen
select field options. Hold Control to key to select more than one.
- Select the result field, it has to be one of the numeric fields created
previously.
- If you want to include the current value of the result field in the
calculation, set the cumulative result to Yes, (E.g. for quotations) otherwise
choose No (E.g. for formulas).
- Configure the rest of options like a normal webform component.

Notes:
- Division by zero is prevented internally.
- Nested webform components in fieldset are supported.

Dependencies
************
- webform (>=7.x-4.x)

Note: due to incompatibilities between webform 7.x-4.x API and previous versions API, this module requires webform version 4.0 or above.

Installation
************

1. Install as usual[1].
2. Create a webform node and create de corresponding fields (see above) in:
   node/%node/webform

File

README.txt
View source
  1. Webform Calculation Components
  2. ******************************
  3. This module provides AJAX functionality to perform basic arithmetic operations
  4. on webform components.
  5. With this module the user can have calculated fields, e.g. the total amount,
  6. calculated percentage etc.
  7. This module provides two new component types:
  8. Webform Calculation Number (Calculation - number)
  9. That component is a numeric field where the user can type a number. The target
  10. field (result field) is set when configuring the Webform Calculation Number
  11. component.
  12. When the webform is displayed, the user can enter numbers in these fields and
  13. the calculation is performed against the result field.
  14. Webform Calculation Hidden (Calculation - hidden)
  15. It can be used to perform operations with existing numeric components.
  16. The calculation is triggered when the user select a specific option in
  17. checkboxes, radio button or select option.
  18. All that is configured when creating the Webform calculation hidden component.
  19. It is possible to perform one operation e.g. Addition to several numeric
  20. fields, then the result will be calculated against the result number component.
  21. Note that select field choices must be selected, (they can be more than one)
  22. and they have to correspond to the select field that triggers the calculation.
  23. The available operations are the following:
  24. [addition]
  25. [subtraction]
  26. [multiplication]
  27. [division]
  28. [percentage]
  29. [modulo]
  30. Configuration:
  31. For Webform Calculation Number
  32. Go to add content > webform (or any webform content type):
  33. - Create a new webform
  34. - Create new webform components, you need at least one numeric component to be
  35. selected as the result field.
  36. - Create a new Calculation - number component.
  37. - Select the arithmetic operation and the result field.
  38. - Optionally the number of decimals can be configured.
  39. - Configure the rest of options like a normal webform component.
  40. For Webform Calculation hidden
  41. Go to add content > webform:
  42. - Create a new webform
  43. - Create new webform components, you need at least two numeric and a select
  44. component.
  45. - Create a new Calculation - hidden component.
  46. - Select the operand field. It has to be one or more of the numeric fields
  47. created previously.
  48. Hold Control key to select more than one.
  49. - Select the arithmetic operation and the result field.
  50. - Select the select field (created previously).
  51. - Select the select field choices. The choices must coincide with the chosen
  52. select field options. Hold Control to key to select more than one.
  53. - Select the result field, it has to be one of the numeric fields created
  54. previously.
  55. - If you want to include the current value of the result field in the
  56. calculation, set the cumulative result to Yes, (E.g. for quotations) otherwise
  57. choose No (E.g. for formulas).
  58. - Configure the rest of options like a normal webform component.
  59. Notes:
  60. - Division by zero is prevented internally.
  61. - Nested webform components in fieldset are supported.
  62. Dependencies
  63. ************
  64. - webform (>=7.x-4.x)
  65. Note: due to incompatibilities between webform 7.x-4.x API and previous versions API, this module requires webform version 4.0 or above.
  66. Installation
  67. ************
  68. 1. Install as usual[1].
  69. 2. Create a webform node and create de corresponding fields (see above) in:
  70. node/%node/webform