How do I add copy this code type multi line "forms" to a web page

Posted on 2009-04-30
Last Modified: 2013-11-19
This may seem basic, but what is the best way to add "copy this code"-type links into a web page.

So that the pages look something like this:

I guess I could copy the html source code on this page, but wonder if there are some tips and hints I should keep in mind when creating such "forms"


Question by:Rowby Goren
    LVL 9

    Accepted Solution

    The sample that you would like to imitate are simply textarea fields with desired styling applied through a class.  The content of the textarea is created by a javascript function.  The fields on the sample have an onclick event to highlight or select the entire text contained to make it easier for copying that could be moved to a link similar to what EE does in the code snippet boxes.
    LVL 9

    Author Comment

    by:Rowby Goren

    Unlike experts exchange snippet, the snippet would already appear on the webpage in a textarea".  

    Do you or anyone know where I can get the onclick event etc to make it easier to copy the code for the website visitor?


    LVL 9

    Author Closing Comment

    by:Rowby Goren
    Thank you!

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Join & Write a Comment

    Suggested Solutions

    Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now