Paste to clipboard, Need a script that allow me to select from 30 different text based mes |
Paste to clipboard, Need a script that allow me to select from 30 different text based mes |
Tim606 |
Mar 29 2022, 12:23 PM
Post
#1
|
Group: Members Posts: 5 Joined: 29-March 22 Member No.: 28,305 |
This is my first post, sorry if I have put it in the wrong place.
I have a very simply web page that holds ticket reply messages. If you work on a help desk you will know the sort of thing I mean, its the type of thing you add to the end of the ticket to close it. At the moment I simply highlight the message Copy and then paste into the ticket. What I would like is a button below each text message that say copy, I can then click the button, text is copied to the clipboard ready to post into a ticket. Now I have found several scripts that allows you to copy one text on a page but I have not found a script that can handle having 15 different messages on a page (I have two pages) that allows me to click what ever message I want. As I mentioned, the it is only two pages, not hosted on a web server simply accessed by a browser direct from the file location. The text messages vary in size, from 2 lines to 5 (short) paragraphs. It is hoped to expand the quantity of message available to use in the future. There are is nothing fancy about the website, it simply a quick efficient way to handle the messages. Unfortunately I know nothing of Javascript so it would be next to impossible to write my own script (I barely manage HTML) Can anybody suggest anything that would help solve my problem |
Tim606 |
Apr 22 2022, 05:58 PM
Post
#2
|
Group: Members Posts: 5 Joined: 29-March 22 Member No.: 28,305 |
OK lets recap a second, I work with a lot of tickets at work, these are displayed on screen in set templates. As I work on them and close these tickets, the same closing message can be used over and over again, I have around 20 of these closing messages.
I have made a single page web site (hosted as a single file and opened in google Chrome) and at present there are about 20 of these message on this web page. They vary in length from 2 lines to 5 paragraphs (210 words) in size, which I simply highlight, copy and paste from the web page in to the ticket I am working on, a small edit and then close the ticket. Saves a lot of typing at the end of the day. Now to make the coding you posted on the 18th April work, I write my text out and code it so it appears correctly formatted with sentences, paragraphs etc. on the web page. I then have to write the same text again (I don't actually write it I just copy and paste and remove the coding and put it in the CODE <input type="text" name="" value=" the copied text goes in here "> . But as I said I can not enter any formatting here as it is basic txt and when copied and pasted into my tickets it has lost all the formatting and appears as a block of text, no sentences or paragraphs. I did play with textarea but as I have multiple "Textareas" I could not find a way to make it work. Hope that is a little clearer This post has been edited by Tim606: Apr 22 2022, 06:01 PM |
Christian J |
Apr 22 2022, 07:48 PM
Post
#3
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
I just copy and paste and remove the coding and put it in the CODE <input type="text" name="" value=" the copied text goes in here "> . I assume the ticket program/interface is an HTML form, judging from the above INPUT element? QUOTE But as I said I can not enter any formatting here as it is basic txt and when copied and pasted into my tickets it has lost all the formatting and appears as a block of text, no sentences or paragraphs. Pasting text into an INPUT element will indeed lose the newline formatting, you'd need a TEXTAREA to preserve that. Are you allowed to make changes to the ticket interface, and will its form handling script accept TEXTAREA instead of INPUT textfields? QUOTE I did play with textarea but as I have multiple "Textareas" I could not find a way to make it work. You mean in the ticket interface? Can't help with that without seeing how the ticket form is coded. If you just want to use multiple TEXTAREA elements for storing the template texts, see if my latest example from April 22 works. |
Lo-Fi Version | Time is now: 27th April 2024 - 08:38 AM |