New forms module issues

edited December 2014 in Modules
I'm using the new forms module displaying the form with a block. In this mode, the HTML form tag and attributes don't seem to be created. Is this normal?

My setup:

My controller:
$params['fields'] = $fields; $params['validation'] = $validation; $params['name'] = 'Submit form'; $params['slug'] = 'myform'; $params['form_action'] = site_url('submissions/myform'); $params['form_display'] = 'block'; $params['block_view'] = 'form_myform'; $vars['form'] = $this->fuel->forms->create('myform',$params); $page_init = array('location'=>__FUNCTION__,'render_mode'=>'view'); $this->fuel->pages->render('myview', $vars, $page_init);

My view:
echo $form->render();

My Block:
echo '<h3>My Title</h3>'; echo $field1_label; echo $field1_field;

The resulting page displays the fields and labels correctly, however it does not surround them in a form tag. If I change the form_display to 'auto', the form tag is present.

Any suggestions? Should I expect to have to add my own form tag?

TIA

Comments

  • edited 8:12AM
    When you use a block, you have to put in the HTML for the form tags and requires a little more manual work. The submission when using auto, goes to forms/process/{form_name}. There are also to hidden fields that get created that you may want to add:
    <input type="hidden" name="return_url" value="http://myreturnpage"> <input type="hidden" name="form_url" value="http://thepagemyformison">
Sign In or Register to comment.