<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=004283720-18082006><FONT face=Verdana size=2>I think it should
be possible. For now, it's very useful to have a flag *in the form itself* that
indicates that it's a programmatic submission (ie,
isset($form['#post'])).</FONT></SPAN></DIV>
<DIV><SPAN class=004283720-18082006><FONT face=Verdana
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=004283720-18082006><FONT face=Verdana size=2>It's definitely
something to explore in a subsequent patch.</FONT></SPAN></DIV>
<DIV><SPAN class=004283720-18082006><FONT face=Verdana
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=004283720-18082006><FONT face=Verdana
size=2>--Jeff</FONT></SPAN></DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Adrian Rossouw
[mailto:adrian@bryght.com] <BR><B>Sent:</B> Friday, August 18, 2006 3:31
PM<BR><B>To:</B> development@drupal.org<BR><B>Subject:</B> Re: [development]
Forms API II: Return of the Chx (you really need toread
this)<BR><BR></FONT></DIV><BR><BR>
<DIV><SPAN class=gmail_quote>On 8/18/06, <B class=gmail_sendername>Jeff
Eaton</B> <<A
href="mailto:jeff@viapositiva.net">jeff@viapositiva.net</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><FONT face=Verdana size=2><BR>function mymodule_create_user()
{<BR> // register a new user<BR> $form =
drupal_retrieve_form('user_register');<BR>
$form['#post']['edit']['name'] = 'robo-user';<BR>
$form['#post']['edit']['mail'] = <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:%27robouser@example.com%27"
target=_blank>'robouser@example.com'</A>;<BR>
$form['#post']['edit']['pass'] = 'password';<BR>
drupal_process_form('user_register',
$form);<BR></FONT></DIV></DIV></DIV></BLOCKQUOTE></DIV>This is awesome, but do
we really need the '#post']['edit'] for every element ?<BR><BR>for shorthand,
couldn't we just do<BR><BR>$edit =
drupal_retrieve_post('user_register');<BR>$edit['name'] =
'robo-user';<BR>$edit['mail'] = 'something';<BR>$edit['pass'] =
'blah';<BR>drupal_process_form('user_register', $edit);<BR><BR>You could have
this as a wrapper of the functionality you mentioned above even.
<BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>