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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

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

Custom Forms Templates Under 2.4


Go to End


4 Posts   1698 Views

Avatar
zenmonkey

Community Member, 545 Posts

10 August 2010 at 6:34am

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?

Avatar
Willr

Forum Moderator, 5523 Posts

10 August 2010 at 2:20pm

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

Avatar
zenmonkey

Community Member, 545 Posts

13 August 2010 at 1:26am

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="">

Avatar
zenmonkey

Community Member, 545 Posts

27 August 2010 at 4:01am

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