Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Form Dropdown has a label of "get_form_label($data)"
#1

[eluser]obiron2[/eluser]
Hi guys.

Using CI 1.6.3

I am prepping data for a form as follows:

Code:
$formfield =>    array(
'name'=>'date_1',
'type'=>'dropdown',
'options'=>array('1'=>'one','2'=>'Two'),
'label'=>'Preferred Date'
);


Then calling the field in the view as follows

Code:
case "dropdown":
  echo form_dropdown($formfield['name'],$formfield['options']);
  break;

The dropdown is populated correctly but the label always contains get_form_label($data)

For other field types I simply call $formfield and the form helper correctly puts the label out

Code:
case "txtarea":
  echo form_textarea($formfield);

but this doesn't seem to work for dropdowns. Also I can't see where it calls the get_form_label($data) for dropdowns or any other fields

NOTE: in 1.6.3, I don't thing the field_label() function exisits

any help would be appreciated

Obiron
break;[/quote]
#2

[eluser]obiron2[/eluser]
Never mind. It's me being a donkey. Smile

I forgot that I had copied the CI form helper and made a local copy in the application directory where I add the labels...

I hadn't got the syntax right on dropdowns.

I will eventually get round to publishing my revised form management process which builds forms in a model, validates the responses against a dataset and handles the transformation of checkboxes to boolean on get and update of database values and other clever things.

Obiron




Theme © iAndrew 2016 - Forum software by © MyBB