Calculate field data on the fly

Norrin - March 31, 2009 - 15:51

I'm running a test site on Drupal 6.10 using the CCK-, Calendar-, Date- and Views-module.

I would like to implement some kind of a logbook. Filling in the entries the user would have to fill in a From-date and a To-date. Also there would be a field (duration) calculating the difference between the given From- and To-date.

To minimize input errors and maximize usability I was wondering if there is an easy - maybe already existing - way to make Drupal calculate the value of the duration time field on the fly, after the user has set the From- and To-date BUT before hitting the send button to enter the data into the database.

I hope you'll get the idea. Any ideas or help is greatly appreciated.

maybe CCK Computed Field?

adam_b - March 31, 2009 - 16:02

It looks pretty complex (http://drupal.org/project/computed_field) but should do what you want.

Alternatively, maybe Views Calc (http://drupal.org/project/views_calc) could display the duration on display - but it doesn't look as if that does subtraction, which you'd need to calculate the time.

Thanks

Norrin - April 1, 2009 - 08:09

for hint, I'll check them out. :o)

 
 

Drupal is a registered trademark of Dries Buytaert.