<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>IIRC, he said he was using MultiBlock, which might change the form_id; it definitely changes the module name and delta for the block. I'm guessing the first problem is using MultiBlock for the user_login_block, as the user module is not multiblock enabled. I think the answer about&nbsp;using hook_forms is the way to go, but last I looked the API docs were really bad on that hook.<BR>&nbsp;</DIV>
<P><FONT face="bookman old style, new york, times, serif" color=#ff007f size=4><EM><STRONG>Nancy E. Wichmann, PMP</STRONG></EM></FONT></P>
<P><FONT face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: arial, helvetica, sans-serif"><BR><FONT face=Tahoma size=2>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif">
<HR SIZE=1>
</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif"><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Earnie Boyd <BR></FONT></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif">Anth wrote:<BR>&gt; Hi Earnie,<BR>&gt; <BR>&gt; Thanks for the answer and that's one of the things to do, but my problem<BR>&gt; at the moment with that path is that in hook_form_alter there doesn't<BR>&gt; seem to be anything that I can use to identify which block it is. Am I<BR>&gt; missing something obvious?<BR>&gt; <BR><BR>The third argument of hook_form_alter is the $form_id and for user_login_block that would be user_login_block.&nbsp; Both $form and $form_state are a pass-by-ref variable so any changes you do happen to the form and/or form_state before they get rendered.<BR><BR>&gt; If there is nothing in the $form then what I think I actually want to do<BR>&gt; is use some code to generate the form and as I have access to the $form<BR>&gt; array to put in my own validation rule or hidden $form element or<BR>&gt; whatever to distinguish between the different blocks.<BR><BR>You
 can add your own validation and submit handlers for the form using hook_form_alter as well.&nbsp; You just need to make sure that your hook_form_alter function uses a pass by ref for the $form parameter and add your validation or submit handlers as appropriate.<BR><BR>&gt; So I'm trying to<BR>&gt; generate the user_login_block myself so I can alter the $form array but<BR>&gt; can't get it to work. In my block code if I call<BR>&gt; drupal_get_form('user_login_block') for the block content everything is<BR>&gt; fine but I can't alter the form object. So I'm trying to do the same<BR>&gt; steps as drupal_get_form, i.e. the code below and the user login block<BR>&gt; displays but there is a bunch of stuff missing from it so it doesn't<BR>&gt; actually submit.<BR>&gt; <BR>&gt; Am I making this harder than I need to for what I'm trying to achieve?<BR>&gt; <BR><BR>If you're doing the same code as drupal_get_form then you are most likely doing the wrong thing
 and making it harder than it needs to be. Be sure to look for the examples at <A href="http://api.drupal.org/" target=_blank>api.drupal.org</A>.<BR><BR>-- Earnie<BR>-- http://progw.com<BR>-- http://www.for-my-kids.com<BR></DIV></DIV></div></body></html>