SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Jan 2003
    0 Post(s)
    0 Thread(s)

    Angry objects and fustration

    Hi there,

    OK, here's the thing - this is one of those bash-your-head-against-the-problem-until-it-bleeds kinda things.

    I have a page that gives the user a packing checklist - the user selects items from the list and clicks the I'm Packed button - a newpage is then generated with the items that were selected so that they can print it out.

    I use an array of objects with two properties, ffName (the checkbox name) and text (the value to be written in the new page), and a method to write the text property to the file. The idea is that I iterate through the array, compare the form element with the name stored in ffName to see if it's checked or not, and then invoke the write method if neccessary.

    This is the loop:
    for(i=0; i< itemArray.length; i++)
    if (formDOM.elements[itemArray[i].ffName].checked == true)
    { itemArray[i].writeToDoc(); }

    looks pretty straightforward, no?

    Now - here's the thing. For some reason IE on my PC opens the page but doesn't print out the list. Using the Netscape 7 javascript window, it tells me that the array that I define to hold my list objects is undefined.
    IE on my Mac is a little more specific - it does write the list - up to array item 18 and then returns an error 'formDOM.elements[..].checked is not an object'

    I really don't know what's going on here. Any ideas anybody?

    check out
    for the full page code (rather large page - problem area in script btw lines 405 and 472) - attached a code snippet to this post as well

    Sorry for the REALLY long post, but had to get the whole problem out there. Hope you guys can help!


    Attached Files Attached Files
    code... debug... debug... *SIGH* DUBUG!


Posting Permissions

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