如何在DispForm.aspx上保留单选按钮?

时间:2018-08-14 02:01:01

标签: sharepoint sharepoint-2013 sharepoint-online

我有一个SharePoint列表,并且表单是完整的单选按钮选择。例如,假设我的选择字段之一是“选项1”,“选项2”和“选项3”。当用户选择一个值并查看表单时,它将仅显示他们选择的值。但是,我仍然希望用户在查看表单时能够看到所有3个选项。如何让列表保留单选按钮的选择?谢谢!

顺便说一句,现在我正在使用自定义表单,并且正在使用在网络上找到的这段代码作为我的JS文件。我需要在此处进行一些更改以使dispform.aspx显示单选按钮吗?

<script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
<style type="text/css">

.ms-formtable

{display:none;}

</style>


<script type="text/javascript">

 $(document).ready(function() {

    //loop through all the spans in the custom layout

    $("span.hillbillyForm").each(function()

    {

        //get the display name from the custom layout

        displayName = $(this).attr("data-displayName");

        elem = $(this);

        //find the corresponding field from the default form and move it

        //into the custom layout

        $("table.ms-formtable td").each(function(){

            if (this.innerHTML.indexOf('FieldName="'+displayName+'"') != -1){

                $(this).contents().appendTo(elem);

            }

        });

    });

});

我尝试将DisplayName部分更改为:

displayname = $(this).SPServices.SPArrangeChoices({ columnName: "data-displayName", perRow: 10 });

但是那没有用,我最终得到了一个空白表格。任何帮助表示赞赏!

0 个答案:

没有答案
相关问题