title: Drupal 6: Working with Hidden Fields
body: <p>I am working on an issue i'm having with hooking a field, setting the default value, and making it hidden. The problem is that it is taking the default value, but only submitting the first character of the value to the database.</p>
  
  <pre><code>//Here is how I'm doing it
  $form['field_sr_account'] = array( '#type' =&gt; 'hidden', '#value' =&gt; '45');
  </code></pre>
  
  <p>I suppose there is something wrong with the way that I have structured my array, but I can't seem to get it. I found a post, <a href="http://drupal.org/node/59660" rel="nofollow noreferrer">http://drupal.org/node/59660</a> , where someone found a solution to only the first character being submitted</p>
  
  <pre><code>//Here is the format of the solution to the post - but it's not hidden
  $form['field_sr_account'][0]['#default_value']['value'] = '45';
  </code></pre>
  
  <p>How can I add the hidden attribute to this?</p>