You are here

README.txt in Webform Calculation Components 7.2

Same filename and directory in other branches
  1. 7 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 first 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 second operand field (optional). For non commutative operations
like subtraction, division and modulo the second operand has to be in the
second operand field. It can be one or more of the numeric fields created
previously. Hold Control key to select more than one. If you want to include
the current value of the result field in the calculation, include it in the
second operand field, that way it will be cumulative.
- 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.
- 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 first operand field. It has to be one or more of the numeric fields
  47. created previously. Hold Control key to select more than one.
  48. - Select the second operand field (optional). For non commutative operations
  49. like subtraction, division and modulo the second operand has to be in the
  50. second operand field. It can be one or more of the numeric fields created
  51. previously. Hold Control key to select more than one. If you want to include
  52. the current value of the result field in the calculation, include it in the
  53. second operand field, that way it will be cumulative.
  54. - Select the arithmetic operation and the result field.
  55. - Select the select field (created previously).
  56. - Select the select field choices. The choices must coincide with the chosen
  57. select field options. Hold Control to key to select more than one.
  58. - Select the result field, it has to be one of the numeric fields created
  59. previously.
  60. - Configure the rest of options like a normal webform component.
  61. Notes:
  62. - Division by zero is prevented internally.
  63. - Nested webform components in fieldset are supported.
  64. Dependencies
  65. ************
  66. - webform (>=7.x-4.x)
  67. Note: due to incompatibilities between webform 7.x-4.x API and previous versions API, this module requires webform version 4.0 or above.
  68. Installation
  69. ************
  70. 1. Install as usual[1].
  71. 2. Create a webform node and create de corresponding fields (see above) in:
  72. node/%node/webform