Since PHP is server based scripting, the only way to do what you describe is to have a javascript post the form every time a field is exited (onMouseOut), have the PHP evaluate the field contents, modify the field values, and then output the form again. Not very efficient. I would go with javascript if possible.
-- Rich