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   1792 Views

Avatar
Todd

31 Posts

1 November 2007 at 5:58am

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

Administrator, 685 Posts

1 November 2007 at 8:22am

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

Avatar
Todd

31 Posts

1 November 2007 at 8:35am

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

Forum Moderator, 922 Posts

1 November 2007 at 9:26am

Edited: 01/11/2007 9:27am

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

31 Posts

1 November 2007 at 4:58pm

Hi Sean,

I'll give this a try.

Many thanks.

Todd