I am working with a drupal module and find it difficult to modify the custom field dynaimically added to the form.

So I want to have a function in the header that recognizes when fieldx is changed, do a calculation with the value of fieldx and change fieldy.

Can that be done without having to add an OnCHange() event to fieldx?

If so, can you give a quick example or link?

Many thanks.