I think what you're looking for is related to the previous post here: http://www3.formassembly.com/forum/discussion/420/calendar-related-javascript/
--- 1. Date calculation from two fields
use by: 1. including the contents of 'code' into your custom code block 2. setting calendar field 1 to variable (example: _DOB) 3. setting calendar field 2 to variable (example: _CHOSENDATE) 4. in a new hidden text field add the formula: _calcDate(_DOB,_CHOSENDATE)