How can I re-format (not validate) the value of a field that a user inputs into a node? I am using the Addressfield module to allow users to input addresses.  I am then using the Location Taxonomize module to generate a taxonomy based on these addresses.

To make everything consistent, I would like to automatically capitalize the first (and only the first) letter of every word (I know there are exceptions where multiple words should be capitalized, but I am willing to deal with those manually).

How can I implement this?
In Drupal 6, you could do something with the nodeapi() hook, eg,

function MYMODULE_nodeapi(&amp;$node, $op, $a3 = NULL, $a4 = NULL)

  if ($node-&gt;type=='TYPEOFNODE' &amp;&amp; $op == 'presave') {
    $node-&gt;field_WHICHEVERFIELD[0]['value']=ucwords($node-&gt;field_WHICHEVERFIELD[0]['value']);
  }

  // other nodeapi()ing goes here

}


In Drupal 7, you could use the node_presave() hook with similar logic.