Guest User

Untitled

a guest
Apr 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // the caller
  2. $form = drupal_get_form('myform', $record_id);
  3.  
  4. // in the form builder...
  5. function myform($form, &$form_state, $record_id) {
  6. // db query the table for that record id
  7. // populate form default values if record found
  8.  
  9. // example
  10. $form['email']['#default_value'] = $query_result ? $query_result['email'] : NULL;
  11. }
Add Comment
Please, Sign In to add comment