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' => 'hidden',
'#value' => 'Unread',
'#attributes' => array('id' => array('stateform')),
);
How can I make it save to the mysql table on submit?
UPDATE:
$form['State'] = array(
'#type' => 'hidden',
'#title' => t('Hidden'),
'#attributes' => array('id' => array('state')),
);
drupal_add_js(drupal_get_path('module','mymodule') . '/js/custom.js');