Multiline Textfield Read-only

Forums Dynamic Forms for SharePoint Multiline Textfield Read-only

This topic contains 4 replies, has 3 voices, and was last updated by  Alexander Bautz 4 months, 2 weeks ago.

  • Author
    Posts
  • #7325

    Corina Honegger
    Participant

    Hi Alex

    The new version is really great, congrats! πŸ™‚
    Unfortunately there is something strange when I try to make a multiline texfield (append mode) ready-only. It doesn’t show up the already written text. It just show the grey dashed field without the entries. Is there a way to show them either when it is not allowed to add new entries?

    Thanks
    Corina

  • #7327

    Alexander Bautz
    Keymaster

    Hi,
    This is currently not added to DFFS, but I have had other requests. This is a workaround you can use.

    Add a function like this to the “Custom JS”

    function appendHistory(){
    	var history = $("#dffs_Textarea1").find("td.ms-formbody div.dffs_tdWrap div").has("a").html();
    	$("#dffs_Textarea1").find("td.dffs-readonly-inner div.dffs_tdWrap").append("<div style='margin:2px;padding:3px;border:2px silver dashed;background-color:#ffffff;'>"+history+"</div>");
    }

    You must change “Textarea1” to your own FieldInternalName.

    Then add a call to this function on the rule that sets the field read only (in the “Run these functions” field).

    Let me know how this works out.

    Alexander

  • #7682

    Corina Honegger
    Participant

    This fix works for me, thank you very much! πŸ™‚

  • #16638

    Jeff Lynch
    Participant

    I’m trying to implement this and it comes back as “undefined” what might I have missed here. We had issues with the field internal name because it had underscores that were converted to the code, before changing them we got a syntax error due to the field internal name, after changing it to underscores it just comes back as undefined.

    Here is the function:
    function appendHistory(){
    var history = $(“#dffs_Worklog_x0020_History”).find(“td.ms-formbody div.dffs_tdWrap div”).has(“a”).html();
    $(“#dffs_Worklog_x0020_History”).find(“td.dffs-readonly-inner div.dffs_tdWrap”).append(“”+history+””);
    }

    and here is the field internal name the way it appears: Worklog%5Fx0020%5FHistory

    again with the original field internal name we get a syntax error, and with the modified name we get “undefined”

  • #16747

    Alexander Bautz
    Keymaster

    Hi,
    Sorry for the late reply. You can see the fieldinternalname in the “List fields” tab in DFFS backend. Ensure you have the correct field name.

    Alexander

You must be logged in to reply to this topic.