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.

Archive

Our old forums are still available as a read-only archive.

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

RequiredFields() on a LiteralField?


Reply

5 Posts   1786 Views

Avatar
Todd

1 November 2007 at 5:58am 31 Posts

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

Avatar
Sam

1 November 2007 at 8:22am Administrator, 679 Posts

Possibly, but I'm not sure - why not use a TextareaField?

Avatar
Todd

1 November 2007 at 8:35am 31 Posts

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

Avatar
Sean

1 November 2007 at 9:26am (Last edited: 1 November 2007 9:27am), Forum Moderator, 921 Posts

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

Avatar
Todd

1 November 2007 at 4:58pm 31 Posts

Hi Sean,

I'll give this a try.

Many thanks.

Todd