It looks like you're new here. If you want to get involved, click one of these buttons!
Fatal error: Call to undefined method Form_builder::create_button()
$params = array('value' => 'Next', 'use_input' => FALSE, 'id' => 'next');
$this->form_builder->create_button($params);
Comments
A PHP Error was encountered Severity: Notice Message: Undefined index: next Filename: compiled/daa8ff4e32a6323524e97b25da079e3d.d17.php Line Number: 149
Here's the code I have in my controller. I can set the button to a variable and then access it in the view just fine, but if I do it that way, it's outside of the div tags and I want it inside the div tags.
// build the form $fields = array(); $fields['name'] = array('label' => 'Contact Name', 'required' => TRUE, 'class' => 'input left'); $fields['company'] = array('label' => 'Company', 'required' => TRUE, 'class' => 'input left'); $fields['address'] = array('label' => 'Address', 'required' => TRUE, 'class' => 'input left'); $fields['phone'] = array('label' => 'Phone', 'required' => FALSE, 'class' => 'input left'); $fields['fax'] = array('label' => 'FAX', 'required' => FALSE, 'class' => 'input left'); $fields['email'] = array('label' => 'Email', 'required' => TRUE, 'class' => 'input left'); // add the next button $params = array('value' => 'Next', 'use_input' => FALSE); $fields['next'] = $this->form_builder->create_button($params); $fields2['inspection'] = array('label' => 'Inspection and Estimate Required by When?', 'required' => TRUE, 'class' => 'input left'); $fields2['location'] = array('label' => 'Name of Location', 'required' => TRUE, 'class' => 'input left'); $fields2['address'] = array('label' => 'Address', 'required' => TRUE, 'class' => 'input left'); $fields2['contactName'] = array('label' => 'Contact Name', 'required' => TRUE, 'class' => 'input left'); $fields2['phoneNum'] = array('label' => 'Phone Number', 'required' => FALSE, 'class' => 'input left'); $fields2['access'] = array('label' => 'Access', 'required' => TRUE, 'class' => 'input left'); $fields2['reason'] = array('label' => 'Reason for Estimate', 'required' => TRUE, 'class' => 'input left'); $fields2['comments'] = array('label' => 'Comments', 'required' => TRUE, 'class' => 'input left'); $this->form_builder->use_form_tag = FALSE; // will set the values of the fields if there is an error... must be after set_fields $this->form_builder->set_validator($this->validator); $this->form_builder->set_field_values($_POST); $this->form_builder->set_fields($fields); $vars['form1'] = $this->form_builder->render(); $this->form_builder->set_fields($fields2); $vars['form2'] = $this->form_builder->render();
if I go to the net console of firebug and look at the http response, here's what is actually returned to the browser. Is there a bug in the create_button function?
<input type="text" name="next" id="next" value="<button type="button" name="" id="" value="Next">Next</button>" size="40" />
Here's the code that's returned:
<label for="next" id="label_next">Next</label> <input type="text" name="next" id="next" value="<button type="button" name="" id="" value="Next">Next</button>" size="40" />
$fields['next'] = array('type' => 'button', 'value' => 'Next', 'use_input' => FALSE);
$params = array('value' => 'Next', 'use_input' => FALSE); $this->form_builder->other_actions = $this->form_builder->create_button($params);