objects of fustration

wxdqz

New Member
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.ffName].checked == true)
{ itemArray.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' :confused:

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

check out

<!-- m --><a class="postlink" href="http://www.tntmagazine.com/uk/newHomePageSet/tguide/travelChoice.asp?guideId=packing">http://www.tntmagazine.com/uk/newHomePa ... Id=packing</a><!-- m -->

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!

Cheers,

azz
 
Back
Top