[support] hook_form_alter() data changed in array but not on screen

Steve Edwards killshot91 at comcast.net
Wed Jun 17 05:27:17 UTC 2009


I'm trying to use hook_form_alter() to write data to a text field when 
the form is first displayed, but for some reason I can't get the values 
to display on the form itself.  I know I have the right form_id, because 
dsm() displays all the data for that form.  What's even weirder is that 
I can see the data being changed in the form itself, but it just won't 
change on the screen.  I can also change the weight of the field 
($form['field_class_name']['#weight']=99;)
and it relocates the position of the field on the screen accordingly.  
But when, for instance, I change the #title and #description of the 
field, the changes are changed in the arrary itself (I can see this by 
putting a dsm() after changing the data), but the values on the screen 
don't change.  I'm making similar changes to other forms within the same 
hook function (different case statements), and they all work fine.  I've 
cleared all my caches (Drupal and browser), but to no avail.  Can anyone 
tell me why my form data isn't changing?

Thanks.

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090616/8e5ae654/attachment-0001.htm>


More information about the support mailing list