Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By pria on
I new in Drupal and I work so hard to understand this one.. I try to make module (just like WebForm module) and i get trouble to attach a file into database.. I can't insert the value of Information and Attachment in this code.. I know i did something wrong, please tell me..
function nota_form()
$form['bio'] = array(
'#type' => 'fieldset',
'#title' => 'Form Input Data',
'#description' => 'Please input your data<br><i>*required</i>',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['bio']['information'] = array(
'#type' => 'textarea',
'#title' => 'Information',
'#default_value' => $information,
);
$form['bio']['attachment'] = array(
'#type' => 'file',
'#title' => 'Attachment',
'#default_value' => $attachment,
//'#required' => TRUE
);
function nota_form_validate($form, &$form_state) {...}
function nota_form_submit($form, &$form_state) {
$informtaion = $form_state['values']['information'];
$attachment = $form_state['values']['attachment'];