0

Can someone share a function or a method to wrap the choice-field into any given number of columns? Say you have a choice-field of “Checkbox” or “Radio” type with 20 choices and want to arrange them in multiple columns or horizontally instead of vertically.

I tried a code from this post, but doesnt work for SP2016.

Thanks and Regards, Himankini

0

Try using below code in content editor /script editor web part on list form(Not tested):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script language="javascript">
    var $j = jQuery.noConflict();
    $j(document).ready(function()
    {
        var firstRadio = $j(".ms-RadioText:eq(0)");
        $j(".ms-RadioText:gt(0)").appendTo($j(firstRadio));
    });
</script>

Reference:

  1. Sharepoint choice field (radio button) is displaying vertically
0

Try this JS code

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
    $(function () {
        var reBuildTR = $('<tr></tr>').append("<th></th>");
        //update RadioField as your field name
        $('table[id^="RadioField"]').find('td').each(function () {
            $(reBuildTR).append($(this));
        })
        $('table[id^="RadioField"]').html("").append(reBuildTR);
    })
</script>

Just add the display name of your choice field instead of "RadioField" at the line $('table[id^="RadioField"]')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.