Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

How to make Date Picker in frontend work


6 Posts   1946 Views


24 January 2011 at 3:37am Community Member, 9 Posts


Sorry if this might sound stupid but I have been trying to make datepicker in my custom form for my site. I have been searching the net already but I cant seem to find any guide on how to make this work. Please help me on this cause im new to silverstripe. Thanks in advance.



24 January 2011 at 4:02am Community Member, 24 Posts


$dateField = new DateField('DateField', 'DateField);
$dateField->setConfig('showcalendar', true);


24 January 2011 at 4:12am Community Member, 9 Posts

Hi mmh, This is my form function but there something that seems to be lacking cause i don't get any errors but the datepicker is still not working

function Form() {

$datefield = new DateField( "Birthday" );
$datefield->setConfig( "showcalendar", true );

      $form = new Form($this, "Form", new FieldSet(

         // List your fields here
         new TextField("FirstName", "First name"),
         new TextField("LastName"),
new TextField("Gender"),
         new EmailField("Email", "Email address"),
new PasswordField("Password", "Password"),
new PasswordField("Password2", "Retype Password"),
new TextField("BusinessName","Business Name"),
new TextareaField("BusinessLocation", "Business Address")

      ), new FieldSet(

         // List the action buttons here
         new FormAction("SignupAction", "Submit","","","button-sign-up")

      ), new RequiredFields( "Email", "FirstName", "Surname" )
$protector = SpamProtectorManager::update_form($form, 'Captcha');
return $form;


24 January 2011 at 5:39am Community Member, 24 Posts

Hi nhoj,

I've tested the code in one blank site - everything works as expected (in SS 2.4.4)...

Attached Files

24 January 2011 at 7:34am Community Member, 9 Posts

It seems to be a css issue because its working when I switch my theme to blackcandy :/


24 January 2011 at 7:44am Community Member, 9 Posts

I got it working now. there was problem with my css

Thanks mmh :)