Hello,
I'm creating new CMS compontent based on banner table. Baner has got image:
static $has_one = array(
'file' => 'File'
);
so I've created getCMSFields method:
public function getCMSFields() {
$fields = new FieldSet(
new TabSet("Root",
new Tab('Dane podstawowe',
…
new FileField( 'file', 'Baner', null, null, null, 'banery'),
…
and in BannerAdmin.php I've created edit form method
function getEditForm($id)
{
…
$actions = new FieldSet(
new FormAction('doUpdateBanner', 'Save')
);
$form = new Form($this, "EditForm", $fields, $actions);
…
return $form;
}
In cms form is created and has enctype multipart/form-data but when I submit firebug shows application/x-www-form-urlencoded; charset=utf-8 and $_FILES is empty. I don't know why enctype is changing.
In firebug I've spotted that submit input is outside <form> tags. But in form.ss everything is inside <form>… When I've moved (using firebug) sumit field inside <form> everything is ok. So it looks like submit is in wrong place. How can I fix it?