code box for banner exchange?

hey there, I need to make a text box for a banner. Everytime i put the code in the text area, the banner shows up in the text box, i just want the code, not the image. How can i do that?

Every major website uses TEXTAREA with good reason – it has the methods select() and focus() whereas CODE does not which means you can highlight the whole code on a single click for the user to copy to clipboard.

For exactly the same copy to clipboard functionality as youtube, google video, myspace and everybody else use this:

<textarea rows=30 cols=30 onclick="copy(this)">
BANNER HTML CODE
</textarea>

<script language=javascript>
function copy(textarea) {
textarea.select();
textarea.focus();
}
</script>

Use this and click once anywhere on the textarea box and the whole text gets highlighted.

Adjust size by changing rows and cols, and put your banner code where it says.

HTML does not get rendered in textarea (same as code) but at least you can highlight the text.

3 Responses to “code box for banner exchange?”

  1. tzumpy says:

    example:
    <textarea name=" INSERT BANNER CODE HERE " cols="40" rows="4"></textarea>
    References :

  2. Vera says:

    I’m sick and tired of seeing textareas used for displaying code. Teaxtareas are to be used in forms (for mailing, or commenting).

    So use the following

    <code style="width: 200px; height: 100px; display: block; overflow: auto">
    Your code here.
    </code>

    Oh and here is a nifty code converter, if you don’t want to keep typing < instead of <, etc:
    http://tutorialtastic.co.uk/converter.php
    References :

  3. E.M.Bed says:

    Every major website uses TEXTAREA with good reason – it has the methods select() and focus() whereas CODE does not which means you can highlight the whole code on a single click for the user to copy to clipboard.

    For exactly the same copy to clipboard functionality as youtube, google video, myspace and everybody else use this:

    <textarea rows=30 cols=30 onclick="copy(this)">
    BANNER HTML CODE
    </textarea>

    <script language=javascript>
    function copy(textarea) {
    textarea.select();
    textarea.focus();
    }
    </script>

    Use this and click once anywhere on the textarea box and the whole text gets highlighted.

    Adjust size by changing rows and cols, and put your banner code where it says.

    HTML does not get rendered in textarea (same as code) but at least you can highlight the text.
    References :

Leave a Reply

Posted on September 30th, 2009 by admin and filed under banner exchange | 3 Comments »
|

Blogroll

    Meta