Hi,
could someone help me by showing me how to get the values of submitted form printed into a node? I have a form block for which I have created a new module.
test_module.info
<?php
name = "Test module"
description = "A test module."
package = Custom
core = 7.x
?>
test_module.module
<?php
function test_module_block_info() {
$blocks['test_module'] = array(
'info' => t('A form test - custom form block'), //The name that will appear in the block list.
'cache' => DRUPAL_CACHE_PER_ROLE, //Default
);
return $blocks;
}
function test_module_block_view() {
$block['subject'] = t('Some text here');
if(user_access('access content')){
$result = drupal_get_form('form_test_module');
$block['content'] = $result;
}
return $block;
}
function form_test_module($form, &$form_state) {
$form['description'] = array(
'#type' => 'item',
'#title' => t('Some text here'),
);
//$form['#action'] = url('test-page');
$form['intended_use'] = array(
'#type' => 'select',
'#title' => t('What you need?'),
'#options' => array('Web Hosting'=>t('Web Hosting'),
'File Server' => t('File Server')),
'#required' => False,
);
$form['submit'] = array(
'#type' => 'submit',