The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Paste to clipboard, Need a script that allow me to select from 30 different text based mes
Tim606
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Tim606
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 22 2022, 07:48 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



QUOTE(Tim606 @ Apr 23 2022, 12:58 AM) *

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.

User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 08:38 AM