Page 1 of 1

Choice field (checkbox) in View Form

Posted: 10 Nov 2017
by Siseto
Hi,

In the View form the choice fields (when set up as checkbox) are returned on one line instead of the default (each value on new row), can I change that?

Capture.PNG
Capture.PNG (6.1 KiB) Viewed 1665 times
Thanks

Re: Choice field (checkbox) in View Form

Posted: 13 Nov 2017
by Nikita Kurguzov
Hello, Siseto!
Try out this code after replacing field name with the Internal field name of your field:

Code: Select all

var values = fd.field('Checkboxes').value().split(';');
var html = '';
for (var i = 0; i < values.length; i++){
    html += values[i] + '<br>';
}
fd.field('Checkboxes').control()._el().html(html);

Re: Choice field (checkbox) in View Form

Posted: 13 Nov 2017
by Siseto
Thanks, that works great!