I’m looking to do calculations between CCK fields. I’ve found some cool ways to add Javascript to a page, but before I get too far into this, I figured I’d ask for some quick advice to see if there was a better way.
Basically, I’m looking to do math on an ‘onchange’ event. If Field A is set (base) and Field B is changed, Field C and D automatically update. Similarly, if C changes, B and D update, and same for D changing B and C. I’m planning to use the technique described at:
http://switchbackcms.com/blog/right-way-include-javascript-your-drupal-form, but at http://drupal.org/node/322290 (#7) there is talk of adding a theme function, which I’m guessing I could do using a nice tpl.php file.
Any suggestions are welcome, especially if there is an already existing module for field relationships.
Joel