Multiline Textfield Read-only

Home Forums Classic DFFS Multiline Textfield Read-only

Viewing 5 reply threads
  • 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

              • #29091
                Alexander Bautz
                Keymaster

                  I’m bumping this old question with an updated solution for later versions of DFFS.

                  Add this to your Custom JS:

                  function appendHistory() {
                      var fin = "YOUR_FIELD_NAME";
                      jQuery("#dffs_" + fin).find(".append_history_placeholder").remove();
                      var history = $("#dffs_" + fin).find("span[dir='none']").next().html();
                      jQuery("#dffs_" + fin).find(".dffs-readonly-inner").append("<div class='append_history_placeholder'>"+history+"</div>");
                  }

                  Replace YOUR_FIELD_NAME with the internal name of your multiline append field.

                  Then, in the rule you use to set the field readonly, call the function appendHistory in the Run these functions / evaluate these rules field.

                  Alexander

              Viewing 5 reply threads
              • You must be logged in to reply to this topic.