Hi. I'm building a form using form_builder class and I need this date picker field. I use the same code as is given in the example here:
http://docs.getfuelcms.com/general/forms#dateNo date picker appear
Controller:
public function index()
{
// load Form_builder;
$this->load->library('form_builder');
// load the custom form fields
$this->form_builder->load_custom_fields(APPPATH.'config/custom_fields.php');
// create fields
$fields['linked'] = array('type' => 'linked', 'linked_to' => array('name' => 'url_title'));
$fields['datetime'] = array('type' => 'datetime', 'first_day' => 2, 'date_format' => 'dd-mm-yyyy', 'min_date' => '01-01-2012', 'max_date' => '31-12-2012');
$fields['test_image'] = array('upload' => TRUE);
$fields['number'] = array('type' => 'number', 'represents' => 'int|smallint|mediumint|bigint', 'negative' => TRUE, 'decimal' => TRUE);
$fields['currency'] = array('type' => 'currency', 'negative' => TRUE, 'decimal' => '.');
$fields['phone'] = array('type' => 'phone', 'required' => TRUE);
$fields['file_example'] = array('type' => 'file', 'overwrite' => TRUE, 'display_overwrite' => TRUE, 'multiple' => FALSE);
$fields['state'] = array('type' => 'state');
$fields['list_items'] = array('type' => 'wysiwyg', 'editor' => 'markitup');
$fields['date_example'] = array('type' => 'date', 'first_day' => 2, 'date_format' => 'd-m-Y', 'min_date' => '01-01-2012', 'max_date' => '31-12-2012');
// set the fields
$this->form_builder->set_fields($fields);
// render the page
$vars['form'] = $this->form_builder->render();
$this->load->view('test', $vars);
}
View file:
" rel="stylesheet" type="text/css" media="all" />
<?=$form?>
">
Comments
What's wrong with it?
$this->form_builder->load_custom_fields(APPPATH.'config/custom_fields.php');
I was confident all needed components are loaded automatically.