How to apply Fieldset

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

02 Nov 2015

If i wanted to take a group of fields, and apply a fieldset tag around them, how would i do that?


thanks

matt

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

03 Nov 2015

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?

User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

03 Nov 2015

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.

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

05 Nov 2015

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?

User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

06 Nov 2015

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests