Home › Forums › Classic DFFS › Copy and Paste Notes Field
- This topic has 4 replies, 2 voices, and was last updated 7 years, 6 months ago by Alexander Bautz.
-
AuthorPosts
-
-
May 12, 2017 at 21:05 #16557
I am using DFFS to “auto document” selections made in the form to the notes field by using the Set field value in rules.
At the completion of the form I would like to offer the user an option button the selects all of the notes and copies to clipboard for pasting into another system.
I have the button setup and appearing on the form ready to run the custom JS function.
<input id="btnNumber1" class="customBtn" type="button" value="Copy Notes" onclick="copytext()">
But I am not sure what the function copytext() would look like for Call_x0020_Notes?
Any ideas?
- This topic was modified 7 years, 6 months ago by Bryan Waldrop.
-
May 17, 2017 at 22:03 #16609
Found this clipboardjs
Looks promising but have still not been able to figure out how to pass field value to it. -
May 18, 2017 at 16:55 #16611
I created a button associated with a function:
<input id="btnNumber1" class="customBtn" type="button" value="Copy Notes" onclick="copytext()">
It is easy enough to create a function placing the field value in a variable
function copytext(){ var notes = getFieldValue("Call_x0020_Notes"); }
I got the developer Zeno to comment that the imperative API would be the way to go.
clipboard.js / demo / function-target.html
But I am not sure what to do it with it.
Any ideas?- This reply was modified 7 years, 6 months ago by Bryan Waldrop.
-
May 18, 2017 at 21:34 #16620
Ended up not using the clipboardjs. This worked for me.
//copytoclipboard function copyNotesToClip() { var txtNotes = getFieldValue('Call_x0020_Notes'); if( window.clipboardData && window.clipboardData.setData ) { window.clipboardData.setData("Text", txtNotes); } } $(spjs.dffs.fields["Call_x0020_Notes"]).find('.ms-formbody').append("<button class='customBtn' onclick='copyNotesToClip();return false'>Copy Notes</button>");
-
May 18, 2017 at 22:23 #16624
I’m glad you figured it out – I have a bit to much at the moment so I’m falling behind on the follow-up.
Best regards,
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.