Results 1 to 5 of 5

Thread: Plain text

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Plain text

    How do you get to show a plain text in an ASP? I want to show some html code (in the page), so that the user can copy and paste it (in their pages). But I want the "<" to be pasted as "<" and not like "&lt;"... and all that stuff.

    How can I do this?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  2. #2
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    You need use a <textarea> for your code, otherwise "<" and some other symbols will be replaced.

  3. #3

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Do you have any example?
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  4. #4
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Give me a minute....

  5. #5
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Here:
    Code:
    <html>
    <head>
    <title>Code Sample</title>
    </head>
    <script language="JavaScript">
    function copyContent(elID){
    var el=document.getElementById(elID)
        el.focus();   
        el.select();
        document.execCommand('Copy');
        alert("Code Copied!");
    }
    </script>
    <body>
    <textarea id="codeSamp" rows="10" cols="100" style="border:none;">This is a test <font face="tahoma">Tahoma</font></textarea>
    <br><input type="button" value="Copy Code to Clipboard" onclick="copyContent('codeSamp')">
    </body>
    </html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width