<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 using hook_forms is the way to go, but last I looked the API docs were really bad on that hook.<BR> </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>> Hi Earnie,<BR>> <BR>> Thanks for the answer and that's one of the things to do, but my problem<BR>> at the moment with that path is that in hook_form_alter there doesn't<BR>> seem to be anything that I can use to identify which block it is. Am I<BR>> missing something obvious?<BR>> <BR><BR>The third argument of hook_form_alter is the $form_id and for user_login_block that would be user_login_block. 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>> If there is nothing in the $form then what I think I actually want to do<BR>> is use some code to generate the form and as I have access to the $form<BR>> array to put in my own validation rule or hidden $form element or<BR>> 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. 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>> So I'm trying to<BR>> generate the user_login_block myself so I can alter the $form array but<BR>> can't get it to work. In my block code if I call<BR>> drupal_get_form('user_login_block') for the block content everything is<BR>> fine but I can't alter the form object. So I'm trying to do the same<BR>> steps as drupal_get_form, i.e. the code below and the user login block<BR>> displays but there is a bunch of stuff missing from it so it doesn't<BR>> actually submit.<BR>> <BR>> Am I making this harder than I need to for what I'm trying to achieve?<BR>> <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>