Display form within a custom field? I've created a module that has a 'form builder' on the admin side.  Once the form has been created, I store the form array in the database.  Then on the front end I've created a custom field that pulls the form array from the database and displays it as part of a node.  Here is the pseudo-code to show my thinking:

- Create form via admin side and store form array in database
- Create node with custom field, choose which form you wish to display
- Set url alias on the node
- When user views url, display the form as part of the node 


The problem I have is that when I complete the form on the front end and press submit, nothing happens.  Looking at the html, it doesn't have a &lt;form&gt; tag, presumably because it's part of a node and not a hook_form.

So, I'm wondering if it's possible to display a submittable form as a custom field?  Or do I need to find another way around this?

Edit:  I'm using the following code to display the form:

function mantis_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

    $element = array();

    switch($display['type']) {
        case 'mantisform_default': {

            // Retrieve the form from the database
            $form_data = mantis_retrieve_form_data($items[0]['mantis_form_id'], 'display');

            $element[]['#markup'] = drupal_render($form_data);

        }
    }
    return $element;
}


Edit:  $form_data structure can be seen here http://pastebin.com/JfeNGBGA  and $element is here http://pastebin.com/HU5NSHd5
You have to check your field handler, node tpl.php or field tpl.php and use drupal_render($yourform), it's the cleanest solution I see.