17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1065 Views |
-
Help with Listbox Field

18 September 2008 at 11:18am
Hi,
I am having a heck of a time getting selected items from a ListboxField to save properly in the database. I'm hoping someone might be able to help me. Here is my code:
<?php
class Networks extends DataObject {
function getCMSFields_forPopup() {
$fields = new FieldSet();
$VerticalSet = DataObject::get("Verticals", '','VerticalName ASC','','');
$dropdownfield = new ListboxField('Verticals', 'Select Associated Verticals', $VerticalSet->toDropDownMap('ID', 'VerticalName'),'VerticalName', 10, true, '');
$fields->push($dropdownfield);return $fields;
}
}
...where "Verticals" is a separate table with a field called Verticals where I wish to store the selected items in this Listbox. But I have two problems.1.) When I pop up the window to add or modify a Network (that's the DataObject which needs to contain this info),I get this error @ the top of the page:
"Notice: Undefined variable: options in C:\wwwroot\wamp\www\adify\sapphire\forms\ListboxField.php on line 68"
2.) The value of the field stores in the database as "Array".
What am I doing wrong???
I know my Value paramter (the 4th param of the ListboxField contrsuctor is wrong, but I don't know what it SHOULD be).
Thanks everyone in advance for your help!
//Garrett
| 1065 Views | ||
|
Page:
1
|
Go to Top |

