SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Manipulate Text Area in DOM

    Hai all,

    <textarea size="70" style="overflow: hidden; width: 500px; height: 30px;" onclick="track('forum1d');highlight(this)">[IMG']http://img530.imageshack.us/img530/7854/imagesharkfs3.jpg[/IMG]
    [IMG']http://img530.imageshack.us/img530/imagesharkfs3.jpg/1/w357.png[/IMG]</textarea>

    This is a text area that displays image link after uplaod an image to imageshack.us

    now i want to retrive the text inside the text area. but i see there is no any properties of text area where i can uniquely identify a text area control.

    I want to retrive the url using a code like below.

    Code:
    var strurl= Document.getElementByID("idhere").value

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Be mindful of the casing. Use document.getElementById and it'll work.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pmw57 View Post
    Be mindful of the casing. Use document.getElementById and it'll work.
    Hai pmw57,

    problem is text area in that page did not have an id or name property

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Yeah, I had to add it when testing and was going to bring it up but that slipped my mind while I was working out why the rest of it didn't work.

    It great to know that it's going for you now.
    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
  •