Prefill content type form field with alter hook I've created a content type with a link type field.
When an user add this content type I want to prefill the link field with the user email.
I've a create a new module named prefilllink with an alter hook :

function prefilllink_alter(&amp;$form, &amp;$form_state, $form_id) {
  dsm($form);
  switch($form_id) {
    case "job_node_form":
      $form["field_apply"]["und"][0]["value"]["#default_value"] = $user-&gt;mail;
      break;
  }
}


But it doesn't work... Any idea?
You need to implement either hook_form_alter() or hook_form_FORM_ID_alter() (there's no hook_alter() which is what your code is implementing at the moment). 

The second is probably preferable as it targets the form you're interested in:

function prefilllink_form_job_node_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  global $user;
  $form["field_apply"][LANGUAGE_NONE][0]["value"]["#default_value"] = $user-&gt;mail;
}