Start with this .. change:<br><br>function myformalter_form_alter($form<div style="direction: ltr;">_id, &$form) {<br> if ($form_id == 'edit-junk-node-form') {<br> $form['attachments']['#collapsed'] = FALSE;
<br> $form['author']['#collapsed'] = FALSE;<br> }<br>}<br><br></div>to:<br><br>function myformalter_form_alter($form<div style="direction: ltr;">_id, &$form) {<br> print $form_id . "<br>";
<br> print "<pre>"; print_r($form); print "</pre>";<br><br> if ($form_id == 'edit-junk-node-form') {<br> $form['attachments']['#collapsed'] = FALSE;<br> $form['author']['#collapsed'] = FALSE;
<br> }<br>}</div><br>When you go to the submission page, it wil spit out the form id. Make sure this matches "edit-junk-node-form" (I suspect it doesn't, form ids don't usually start with 'edit').
<br><br>If it does match, check the rest of the output and make sure 'attachments' and 'author' are correct array indexes to be targeting.<br><br>William.<br><br><div><span class="gmail_quote">On 7/18/07,
<b class="gmail_sendername">John Thomas</b> <<a href="mailto:drupal.org-2007@jt-socal.com">drupal.org-2007@jt-socal.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In Drupal 5.1, when creating a node type junk, I would like the Author<br>and Attachments blocks to be expanded (i.e. ['#collapsed'] = FALSE;)<br><br>Based on searching around <a href="http://drupal.org">drupal.org
</a>, I decided to create a module to<br>achieve this. Following is my code. It does not seem to work, the<br>attachments and author blocks are still collapsed. Can you help? Any<br>suggestions so I can learn how to debug this myself? I do have the
<br>devel module installed now.<br><br><?php<br>// $Id:<br><br>/**<br> * @file<br> * My module to modify forms.<br> *<br> * I create a module to modify forms to my liking.<br> */<br><br><br>/**<br> * Implementation
<br> */<br><br>function myformalter_form_alter($form_id, &$form) {<br> if ($form_id == 'edit-junk-node-form') {<br> $form['attachments']['#collapsed'] = FALSE;<br> $form['author']['#collapsed'] = FALSE;
<br> }<br>}<br><br>-- Sincerely, John Thomas<br>--<br>Sincerely,<br>John Thomas<br>--<br>[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]<br></blockquote></div><br>