Jump to:

23374 Posts in 18175 Topics by 2866 members

General Questions

SilverStripe Forums » General Questions » DatePicker not displaying in Custom Form

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

Page: 1
Go to End
Author Topic: 517 Views
  • K_T
    Avatar
    Community Member
    8 Posts

    DatePicker not displaying in Custom Form Link to this post

    Hi All,

    I am having a form that contains a DateField along with some Select and Textbox.
    I created the form using a public function MyForm(){ } and it worked great and i am getting the form in the Frontend exactly like i want but i have to decorate it a bit so i tried to go for the Custom Form to make layout as per requirement.Now the problem is it is displaying all fields correct except that DateField the HTML generated for it show it as a plain textbox

    <input type="text" value="" name="dt" id="SearchForm_dtfield" class="text"> when i tried displaying it using $dataFieldByName(dtfield)

    Any Idea why is it behaving so..??

    Thanks
    K_T

  • K_T
    Avatar
    Community Member
    8 Posts

    Re: DatePicker not displaying in Custom Form Link to this post

    Hi Guys,

    AnyOne Please . . has anycome used DateField with Custom Form . . ??

    Thanks

  • Banana
    Avatar
    Community Member
    18 Posts

    Re: DatePicker not displaying in Custom Form Link to this post

    You can create a new class, extending the dateField class. In this calls overwrite the Field method to create your wanted HTML code.

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: DatePicker not displaying in Custom Form Link to this post

    Use $dataFieldByName(dtfield).FieldHolder

  • K_T
    Avatar
    Community Member
    8 Posts

    Re: DatePicker not displaying in Custom Form Link to this post

    Thanks WillR It Worked..

    517 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.