SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2002
    Location
    Atlanta, GA, USA
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Writing new text to named TextArea in NS?

    In a JS script I have this code:
    document.all.SlideText.value = desc[idx];

    (desc is an array of text strings, SlideText is the name of a TextArea object).

    This works fine in IE, but how do I change it to address correcly in NS (6 and/or 4)?

    TIA for any help.

    /Claus

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use this

    PHP Code:
    if(document.layers){  //NN4

    document.layers['layername'].top  y
    document
    .layers['layername'].left x

    }else if(document.getElementById){  //NN6 & IE5+

    document.getElementById("layername").style.top  y
    document
    .getElementById("layername").style.left x

    else if(document.all){ //IE4

    document.all.layername.style.posTop  y
    document
    .all.layername.style.posLeft x


    Last edited by Andrew-J2000; May 6, 2002 at 21:52.

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you writing to a layer or a textarea? if to a text area then it would be this format for NS:
    document.form_name.field_name.value="some value"

    This will also work for IE.


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
  •