The module I develop has registered a menu item and several local tasks beneath. When the user navigates to a certain local task, I'd like to display a form using the Forms API. I already managed to display the form, but it comes to a JavaScript error as soon as I enter something into the autocomplete field.
Because I have no node type to deal with, I assume I have to set up the '#type' => 'form' myself. But I'm not sure about that at all.
Looking at the form's source code I found out all id and name parameters are empty. Would be great if somebody could comment the approach or suggest a different one.
<?php
function pobox_page_callback( $arg='newmail') {
$return = '';
switch ($arg) {
case 'newmail':
$newmail_form['newmail'] = array(
'#type' => 'form',
'#title' => t('Submit a personal message')
);
$newmail_form['newmail']['recipient'] = array(
'#type' => 'textfield',
'#title' => t('Recipient'),
'#size' => 30,
'#maxlength' => 60,
'#autocomplete_path' => 'user/autocomplete',
'#weight' => -1
);
$newmail_form['newmail']['submit'] = array(
'#type' => 'submit',
'#value' => 'submit form',