How to pre-populate a field with the current users name?
To answer the question posed in the title of this question, you could in a custom module do something along the lines of...

function MYMODULE_form_alter(&amp;$form, $form_state, $form_id) {
  global $user;

  if ($form_id=='NODETYPE_node_form') {
     $form['field_FIELD'][0]['#default_value']['value']=$user-&gt;name;
  }

  // any other form alters you need

}


where MYMODULE is the name of your custom module, NODETYPE is the content type in question and FIELD is the field name in question without the field_ prefix.  Now, whenever you are editing or creating a content type of NODETYPE, the FIELD in question will have a prefilled default value of the current user's name.

Now, if this is a different form, you'll just need to adjust the $form_id== construct to point to that form, the field in that form, etc, but the rest of the logic should be the same.