Please HELP! Code tags needed... -

Discussion in 'HTML & Website Design' started by gweb, Feb 2, 2008.

  1. #1
    Hi I have a text area HERE - and I want it so that when the visitor clicks in the box - it automatically 'selects all'.

    At the moment they have to manually scroll to select all and then copy. Please can someone help me with what the code is for this...?




    :confused: PLEASE :cool:
     
    gweb, Feb 2, 2008 IP
  2. dem0x7

    dem0x7 Peon

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi gweb,

    Try this Javascript onclick code in your text area box:

    <textarea name="textarea" rows="10" cols="80" onClick="javascript:this.form.textarea.focus();this.form.textarea.select();">
    Code (markup):
    That should do it for you, let me know if it works. Remember to replace the "textarea" in the code, to whatever your textarea name is!
     
    dem0x7, Feb 2, 2008 IP
    sawz likes this.
  3. gweb

    gweb Well-Known Member

    Messages:
    1,167
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    130
    #3
    OK thanks!!! I will try this now and I hope it works :)
     
    gweb, Feb 3, 2008 IP