• Archives

  • AddThis Social Bookmark Button

    Add to Technorati Favorites

  • Creating a button to select everything in a text area.

    By krates | December 10, 2007

    Here is a simple script sometimes you want to highlight verything in a text field so that the user can copy it or something.

    script goes here

    <form>
    <center>
    <input type=button value=”Highlight All” onClick=”javascript:this.form.textarea.focus();this.form.textarea.select();”>

    <br>

    <textarea NAME=”textarea” ROWS=10 COLS=30 WRAP=VIRTUAL>

    Put all the content over here.

    Thanks kushagra
    </textarea>
    </center>
    </form>

    just notice one the textarea name is textarea and

    javascript:this.form.textarea.focus();this.form.textarea.select();

    Change every textarea word with the name of your text area

    and for a google type by just clicking on textarea everything gets selected you can do\

     <form>
    <center>

    <textarea NAME=”textarea” ROWS=10 COLS=30 WRAP=VIRTUAL onClick=”javascript:this.form.textarea.focus();this.form.textarea.select();”>

    Put all the content over here.

    Thanks kushagra
    </textarea>
    </center>
    </form>

    thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    Topics: Javascript | No Comments »

    Related Links:

    Comments

    Security Code: