1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1922 Views |
-
problems saving date data - CompositeDateField

22 September 2009 at 12:43am Last edited: 22 September 2009 12:44am
hi again,
I'm using model admin and now can insert rows in the backend. I defined also this field:
"Geburtsdatum" => "Date"
im my $db array.
the backend form ask me for this field with a simple input field.
but in the frontend I replace the field:
$geburtsdatum = new CompositeDateField(
'Geburtstag',
'Geburtstag (Tag, Monat, Jahr)','','1910-2009'
);
$fields->replaceField('Geburtsdatum',$geburtsdatum);so I have a better input format (3 dropdowns).
the problem now is, the date dont't loads ($form->loadDataFrom) into the 3 dropdown fields
and I also can't update the date from the frontend form.what could be the problem here?
thx
daniel -
Re: problems saving date data - CompositeDateField

22 September 2009 at 9:34am
Where did you put that code snippet?
-
Re: problems saving date data - CompositeDateField

22 September 2009 at 6:37pm
hi sam,
I extend the Member class and put it in the getFrontendFields function:
public function getFrontendFields() {
$fields = $this->scaffoldFormFields(array(
'restrictFields' => array(
'Anrede',
'FirstName',
'Surname',
'Ort',
'Email',
'Geburtsdatum',
),
'fieldClasses' => array(
'Email' => 'EmailField',
)
));
$fields->changeFieldOrder(array(
'Anrede',
'FirstName',
'Surname',
'Ort',
'Email',
'Geburtsdatum'
));
$geburtsdatum = new CompositeDateField(
'Geburtstag',
'Geburtstag (Tag, Monat, Jahr)','','1910-2009'
);
$fields->replaceField('Geburtsdatum',$geburtsdatum);
return $fields;
}daniel
| 1922 Views | ||
|
Page:
1
|
Go to Top |


