Page 1 of 1

How to apply Fieldset

Posted: 02 Nov 2015
by schuess
If i wanted to take a group of fields, and apply a fieldset tag around them, how would i do that?


thanks

matt

Re: How to apply Fieldset

Posted: 03 Nov 2015
by rostislav
The easiest thing is to use a table and set its border. Just put all your fields inside a table, then add

border: 1px solid black;
into its style attribute.

Does that satisfy your requirements?

Re: How to apply Fieldset

Posted: 03 Nov 2015
by schuess
Well it does not give you the text that is built into the border like a traditional fieldset does, but if the alternative is extremely complex, i guess it will have to do.

Re: How to apply Fieldset

Posted: 05 Nov 2015
by rostislav
An SP form is an html table, where each field is a table row. You cannot simply insert a fieldset around table rows. You could move all fields outside the table and wrap them around a fieldset, but that would break existing CSS.

You could simply add a caption to the table. If you want, you can also position it right on the table border. This will add such a caption:

$(".mytable").prepend("<caption style='position: relative;top: 8px;width: 100px;background: white;margin-left: 50px;'>Monthly savings</caption>")
You have to add a CSS Class name 'mytable' (in Forms Designer) to the table for this to work.

You may have to tweek it a little bit to suit your needs. If you change the caption's text you'll have to change its width too.

Note that this will leave a small amount of space above the table.

Is this okay for you?

Re: How to apply Fieldset

Posted: 06 Nov 2015
by schuess
Thanks for the info. I was interested in what all the options were. It is not a hard requirement that i need. This will suffice.