I need to add some fields than can take numeric values and enable Drupal to calculate it. I chose an integer field, tried to do some simple math, but Drupal 7 treats values of integer field as text. Moreover, integer field type widget can be only set up as text. Can anybody help me, and tell me how to add field with number values?
The reason why the widget for an Integer field is a text field is that the form element used from a browser is a text field. This means the browser is always returning text for an integer field. This should not be a problem, since:
|
|||
|
By using Computed Field module you can achieve your goal, You need to have a good working knowledge of PHP and the Drupal API to use this module. |
|||
|
I maintain a small module called SpinInt on drupal.org which allows you to specify a scrolling integer widget in your field setup. Not sure if that's any interest but it's a bit friendlier than a text field I guess. |
|||
|