SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Canada
    Posts
    730
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript for SELECT and COPY

    I tried the following to select/highlight and copy the textarea:
    Code:
    <input style="float: left; background-color: #B5A26F; border-color: #98A9A9; 
    width: 150px; font-weight: bold; color: #FFFFFF;" type="button" value="Select All" 
    onClick="javascript:document.getElementById('forum_quote').focus(); 
    document.getElementById('forum_quote').select();" />
    I'm getting this error:
    Error: document.getElementById("forum_quote") is null
    Source File: http://...new/twotexts/textareasample.php
    Line: 1
    Compare bible texts (and other tools):
    TheWheelofGod

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    What does the html for the textarea look like?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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