Hi Guys,
Can you use RequiredFields() on a LiteralField?
Here is my literalfield:
new LiteralField("Comments", "<label class='left'>Comments:</label><br //><textarea name='Comments' rows='5' cols='20'></textarea>")
Thanks,
Todd
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Hi Guys,
Can you use RequiredFields() on a LiteralField?
Here is my literalfield:
new LiteralField("Comments", "<label class='left'>Comments:</label><br //><textarea name='Comments' rows='5' cols='20'></textarea>")
Thanks,
Todd
Possibly, but I'm not sure - why not use a TextareaField?
Hi Sam,
I would. But there would be formatting issues, unless you can tell me how to add a <br /> between "Comments:" and the textarea.
Todd
Instead of adding a <br /> you can use CSS to make the width of the label long enough that it pushes down the textarea field below the label. I assume that's what you're after.
Most likely it would be, this, on a TextareaField (assuming you called the field 'Comments'):
form #Comments label {
width: 100%;
display: block;
}
Cheers,
Sean
Hi Sean,
I'll give this a try.
Many thanks.
Todd