SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Addict Percipient's Avatar
    Join Date
    Jun 2000
    Location
    Summerland, BC, Canada.
    Posts
    226
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    NN JavaScript Problem

    I have a textarea that is supposed to display a description for a book, and the description changes, depending upon which book cover is hovered over. Well, it works in IE 5.5, anyway. However, when I try it in NN 4.08, it complains "document.desc.bookDesc has no properties."

    Here's the HTML code for the form:
    Code:
    <form name="desc" action="#">
    <textarea name="bookDesc" rows="8" cols="60" class="bookDesc">
    Hover over a book cover for a short description.
    </textarea>
    </form>
    And here is the JavaScript:
    Code:
    var ttc_desc="It was the best of times, it was the worst of times.";
    
    function describe(book) {
     if (book!="") {
      document.desc.bookDesc.value=eval(book+"_desc");
     }
    }
    In the <img> tag of each book cover is this snippet:
    Code:
    onmouseover="describe('ttc')"
    So why doesn't Netscape work with it? textarea.value is a JavaScript 1.0 property, so it's not like I'm trying to do something IE exclusive.

    I've also tried just document.bookDesc.value, but I get the same error.

    Your help is greatly appreciated.
    Last edited by Percipient; Jun 22, 2001 at 08:52.
    Ed Rands


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
  •