Hi,
I want to render a form in a custom way and keep the popup calendar. I am using 2.4.2 and the code for the form is as follows...
public function MyDateForm()
{
$fields = new FieldSet();
$dfFrom = new DateField('DateFrom', 'DateFrom');
$dfFrom->setConfig('showcalendar', true);
$dfFrom->setLocale('en_GB');
$dfFrom->setConfig('dateformat', 'YYYY-mm-dd');
$fields->push($dfFrom);
$actions = new FieldSet(new FormAction('StartDate', 'StartDate'));
return new Form($this, "DateForm",$fields,$actions);
}
the calendar popup is not added if I try and customise the form output, can anyone see anything in the later two exaples that would enable it?
does work, but does not allow customisation of the form...
<div id="LeftPane">
$MyDateForm
</div
does not work
<div id="LeftPane">
<% control MyDateForm %>
<form $FormAttributes>
<fieldset>
<p>
$dataFieldByName(DateFrom)
</p>
<p class="Actions">
<% control Actions %>
$Field
<% end_control %>
</fieldset>
</form>
<% end_control %>
</div>
also does not work...
<div id="LeftPane">
<% control MyDateForm %>
<form $FormAttributes>
<fieldset>
<% control Fields %>
<p>
$Title
<br />
$Field
</p>
<% end_control %>
<p class="Actions">
<% control Actions %>
$Field
<% end_control %>
</p>
</fieldset>
</form>
<% end_control %>
</div>
Any help is much appreciated!