When you type a keyword and submit the form the default value is submitted instead. Anyone have an idea how to fix this?

Comments

jweberg’s picture

Status: Active » Closed (fixed)

Issue has been fixed.

mha’s picture

Good day all,
Please could anyone help me with why this form submit only the default values; zeros 0,0.... for any entry?


function my_module_menu($may_cache) {
  $items = array();
  $items['my_module/form'] = array(
    'title' => t('My form'),
    'page callback' => 'my_module_form',
    'access arguments' => array('access content'),
    'description' => t('My form'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

function my_module_form() {
  return drupal_get_form('my_module_my_form');
}

function my_module_my_form($form_state) {
  $form['name'] = array(
    '#type' => 'fieldset',
    '#title' => t('Name'),
    '#collapsible' => TRUE,
    '#collapsed' =>true,
  );
$form['name']['first']=array(
'#type'=>'textfield',
'#title'=>t('sn'),
'#size'=>56,

);
$form['name']['second']=array(
'#type'=>'textfield',
'#title'=>t('name'),
'#size'=>64,

);

 function my_module_my_form_submit($form_id, $form_values){
 $sn=$form_values['sn'];
 $name=$form_values['name'];

db_query("INSERT INTO {test} (sn,name) VALUES ('%d', '%d')") ;
drupal_set_message(t('your data is saved'));}

     $form['submit']=array(
    '#type' => 'submit',
    '#value' => 'Submit',
      );



  return $form;
  }
mha’s picture

Category: bug » support
Status: Closed (fixed) » Active
jweberg’s picture

Category: support » bug
Status: Active » Closed (fixed)

This is a closed issue for custom search box. If you are looking for support on your module you should post in the forums. Please do not change the settings for issues.

mha’s picture

Thank you. But I think we should not be late in learning. Please refer me to the point where the case is closed.

jweberg’s picture

This problem has been resolved in this module. This is an issue thread for the module. If you need support for something other than this module you need to post in the forums. I hope you understand.