21285 Posts in 5732 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 882 Views |
-
$dataFieldByName(MyDateField) - not using calendar

12 October 2010 at 1:44am
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
</divdoes 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!
-
Re: $dataFieldByName(MyDateField) - not using calendar

12 October 2010 at 7:47am
Hi,
Is jquery included in your header and is the jscript for the calendar field in your website's sourcecode?
-
Re: $dataFieldByName(MyDateField) - not using calendar

12 October 2010 at 10:29pm Last edited: 12 October 2010 10:29pm
Thanks bartvanirsel!
That helped - the following JavaScript is in the $MyDateForm - but not the others...
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery.ui.datepicker-en-GB.min.js
http://localhost/aoa/sapphire/thirdparty/jquery-metadata/jquery.metadata.js?m=1268274558
http://localhost/aoa/sapphire/javascript/DateField.js?m=1278917861I've had a search for them and they relate to the date field... but I'm struggling to see why one date filed gets created and the other doesn't as it must go through the same code... but that is a great hint, thanks again.
| 882 Views | ||
|
Page:
1
|
Go to Top |


