How to send hidden field value to db on webform submit I am using Drupal 7 webform api, have a created a field in my _form_alter hook in a custom module, but while on page load the hidden field contains the correct value, when I submit the form it does not save to the mysql table, and gives me an empty cell

$form['State'] = array(
  '#type' =&gt; 'hidden',
  '#value' =&gt; 'Unread',
  '#attributes' =&gt; array('id' =&gt; array('stateform')),    
);


How can I make it save to the mysql table on submit?

UPDATE:

$form['State'] = array(
'#type' =&gt; 'hidden',
'#title' =&gt; t('Hidden'),    
'#attributes' =&gt; array('id' =&gt; array('state')),
);
drupal_add_js(drupal_get_path('module','mymodule') . '/js/custom.js');
You also will need to write a hook_form_submit for your form. In the _form_submit() you will take the hidden value and store it where you like.

That is the simple answer for your question. If you provide more details there could be other ways of handling the data. What is your form action?