hook_form_alter to create table field I created a form which takes user input for fields: title, link, date and description, however I have another field which is guid and it cannot be user created. This field needs to be created with hook_form_alter() which takes the user inputted link and concatenates a string to the front and then return it to the submit handler for db_insert. How can I go onto doing this? here is my submit handler

function rss_list_creator_form_submit($form, &amp;$form_alter) {
//$GUID = returns GUID from hook_form_alter()
$query = db_merge('rss_table')
-&gt;key( array('GUID' =&gt; $GUID))
-&gt;fields( array(
'title' =&gt; $form_state['values']['title'],
'link' =&gt; $form_state['values']['url'],
//'GUID' =&gt; $GUID,
'date' =&gt; $form_state['values']['date'],
'description' =&gt; $form_state['values']['description'],
))
-&gt;execute();
}


**I solved my problem, since I have two forms available I needed to enclose the code in a switch statement. Here is the code block:

function rss_list_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 switch ($form_id) {
  case 'rss_list_creator_form':
  if(isset($form_state['values']['url'])){
    $guid = 'tag:news.google.com,2005:cluster=' . $form_state['values']['url'];
  }
  $form['guid'] = array(
    '#type' =&gt; 'hidden',
    '#default_value' =&gt; !empty($guid) ? $guid : '',
  );
  break;
 }
}
you can try with hidden field. You can make #guid field a hidden field. in your hook_form_alter() #guid initially will hold the default value to empty on submission, you can make #guid fields value to whatever you want to make.

funciton mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id){
  if(isset($form_state['values']['url']){
    $guid = 'extra string' . $form_state['values']['url'];
  }
  $form['#guid'] = array(
    '#type' =&gt; 'hidden',
    '#default_value' =&gt; !empty($guid) ? $guid : '';
    );
}