[support] How pass the parameter for form

frio_at_yandex frio at yandex.ru
Wed Mar 18 17:41:03 UTC 2009


bharani kumar:
>
> This is my snippet
>
>  how to pass the argument for the form function ,
>
> Below is the sample one, but not working,can u make it work,
>
> $output[] .=drupal_get_form('username_form','$usernameID','$username');
>
>
>
> function username_form(&$node, $form_values){
> $form['userName'] = array(
> '#type' => 'select',
> '#title' => t('User Name'),
> '#options' => array(
> $usernameID => '$username',
> ),
> '#default_value' => '1',
> '#description' => t(''),
> '#required' => TRUE
> );
> return $form;
>
> }
Try not to use single quotes for variables. Like this:

$output[] .= drupal_get_form('username_form', $usernameID, $username);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090318/fbea7068/attachment.htm>


More information about the support mailing list