You are here

function faq_form in Frequently Asked Questions 5

Same name and namespace in other branches
  1. 5.2 faq.module \faq_form()
  2. 6 faq.module \faq_form()
  3. 7 faq.module \faq_form()

File

./faq.module, line 166

Code

function faq_form(&$node) {

  // question
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Question'),
    '#default_value' => $node->title,
    '#required' => TRUE,
    '#weight' => 0,
    '#description' => t('Question to be answered'),
  );

  // answer
  $form['body_filter']['body'] = array(
    '#type' => 'textarea',
    '#title' => t('Answer'),
    '#default_value' => $node->body,
    '#rows' => 20,
    '#required' => TRUE,
    '#description' => t('This is that answer to the question.  It will be filtered according to the input format.'),
  );
  $form['body_filter']['format'] = filter_form($node->format);
  return $form;
}