Choice Field - can you have multiple columns

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
Roo
Posts: 107
Joined: Tue Oct 24, 2017

29 Jul 2020

Hi

This is a O365 set up.

With the Choice fields I have one i'm setting up at the moment that has a lot of choices (40 ish Multiple options)

Is it possible to make the choice field multiple columns - just two would be great so that the form isn't so long.

(PS I can't split the choices unfortunately)


Thanks

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

30 Jul 2020

Hello Roo,

Please find the code samples in this thread:
viewtopic.php?f=1&t=376

User avatar
Roo
Posts: 107
Joined: Tue Oct 24, 2017

30 Jul 2020

I'm using this:
fd.field('Samples_x0020_Required').control()._el().html(content);

var options = fd.field('Samples_x0020_Required').control()._el().find('td');
var content = '<table>';
for (var i = 0; i < 27; i++) {
content += '<tr>';
for (var j = 0; j < 3; j++) {
if (options.length > i + 3 * j) {
content += '<td>' + options.eq(i + 27 * j).html() + '</td>';
} else {
content += '<td></td>';
}
}
content += '</tr>'
}
content += '</table>';
fd.field('Samples_x0020_Required').control()._el().html(content);
Is there any way of blanking the "Undefined" option? my list will grow and shrink in time

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

31 Jul 2020

Hello Roo,

What do you mean with "Undefined" option? Could you please provide more details.

User avatar
Roo
Posts: 107
Joined: Tue Oct 24, 2017

31 Jul 2020

its where there isn't a field:
spform1.jpg
spform1.jpg (65.42 KiB) Viewed 9787 times

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

03 Aug 2020

Hello Roo,

Please try ou this code from the thread:

Code: Select all

var options = fd.field('Option').control()._el().find('td');
var content = '<table>';
for (var i = 0; i < 5; i++) { //Rows
content += '<tr>';
for (var j = 0; j < 6; j++) { //Columns
if (options.length > i + 5 * j) { //Rows
content += '<td>' + options.eq(i + 5 * j).html() + '</td>'; //Rows
} else {
content += '<td></td>';
}
}
content += '</tr>'
}
content += '</table>';
fd.field('Option').control()._el().html(content);
You can change the number of rows and columns.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests