Jump to:

1973 Posts in 1276 Topics by 607 members

Form Questions

SilverStripe Forums » Form Questions » Custom Forms Templates Under 2.4

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

Page: 1
Go to End
Author Topic: 981 Views
  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Custom Forms Templates Under 2.4 Link to this post

    Has the Method for using Custom form templates changed under 2.4

    I'm trying to create a form using HTML5 input types. In my Custom form I use the following code

    <label for="{$FormName}_Email">Email</label>
    <input type="email" value="" name="Email" id="{$FormName}_Email" class="text">

    However the form doesn't accept the input unless the input is generated using $dataFieldByName(Email)

    Any Ideas?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Custom Forms Templates Under 2.4 Link to this post

    Is there any difference between the html generated in $dataFieldByName and the html outputted from yours?

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: Custom Forms Templates Under 2.4 Link to this post

    Other then SS changing the attribute order I don;t see a difference

    SS generated input
    <input type="text" value="" name="Email" id="BVRegistrationForm_BVRegistrationPage_Email" class="text">

    my code:
    <input type="email" value="" name="Email" id="{$FormName}_Email" class="text">

    Input generated from my code
    <input type="email" class="text" id="BVRegistrationForm_BVRegistrationPage_Email" name="Email" value="">

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: Custom Forms Templates Under 2.4 Link to this post

    I have noticed this bug only presents itself under 2.4.1. 2.4.0 seems to work as expected. I've added a ticket

    981 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.