Basic field calculation in Form

Hi,

I have a Form, it has fields: StartDate, UntilDate, DaysTaken
Please advise how to make DaysTaken auto-calculation when I insert StartDate and UntilDate field.

Example:

StartDate: 9 Feb 2014
UntilDate: 12 Feb 2014
DaysTaken: 3 (which auto-calculation from above fields)

Thank you for your help.

Kind regards,

create an ajax even onblur on untildate. There you do the calculation and put the result in daystaken. See: http://stackoverflow.com/questions/3090067/subtracting-dates-in-php