I am trying to create a simple form w/ forms API but have no idea how to do this. I have created a page at ?q=node/214. I want to pass some values through the form to this page so that the URL shows up as ?q=node/214&value=3 for example. What am I doing wrong w/ a form like the one below?

  $options = array(
	'1' => t('option 1'), 
	'2' => t('option 2'),
	'3' => t('option 3')	
	);
  
  $form['someform'] = array(
    '#type' => 'select',
    '#title' => t('title of form'),
    '#options' => $options
  );
  
  $form['#action'] = url('node/214');
  $form['submit'] = array('#type' => 'submit', '#value' => t('query'));
  $output = drupal_get_form('test_form', $form);
  return $output;

Comments

localhost’s picture

can anybody point me in the right direction please...simple example would go a long way...any help is greatly appreciated

chx’s picture

#method => GET but note that form API does not really support this and it's generally a very bad idea. See search.module for a better idea: redirect to a clean URL if you want your submitted form to be bookmarkable .
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.