Altering form values
View only fields can only be updated via the API, see: https://issues.civicrm.org/jira/browse/CRM-17843

So you could use one of the hooks (eg: hook_civicrm_pre) to 'detect' when that field has changed, and read the value, and then use the API to set the other value. _pre might be more reliable than the form hooks, as the field might be set by other methods than by submitting a form.

For example:

function foo_civicrm_pre($op, $objectName, $id, &amp;$params) {
  if ($objectName == 'Contact' &amp;&amp; empty($params['custom_xxx'])) {
    // make an API call to set custom_yyy
  }
}