[thelist] Javascript Cart Problem

Shannon Skinner shannon at atomicindustries.co.nz
Thu May 3 22:09:13 CDT 2001


Matthew wrote:
>I'm trying to build my shopping cart system and I'm running into a
javascript
>problem.
>
>here is the cart:
>
>http://atomicmedia.net/am/fontcart35.htmlx
>
>It works in IE for Mac, but that is it. The problem started when I use an
image
>for a submit button rather than a submit button. The error i get in
Netscape or
>IE Windows is:
>
>document.theForm has no properties
>
>can anyone see what i am doing wrong??

Well, I thought it was cool seeing another "atomic" dude on this list so
thought I would reply and see if I could help out :)

<fyi>The error I get in Win98, IE5.5 is: "Error: 'document.theForm' is null
or not an object"</fyi>

Looking at the code for your forms you have got: <form name "theForm">
This should probably be: <form name="theForm">

My guess is that the browser can't find the object you're calling because it
isn't named "properly".

Also you've got two forms with the same names ("theForm") which may cause
you trouble. You should (a) give them different names or (b) access the
forms through the form collection thingy in the DOM.

I used suggestion (a) by copying and pasting your code into a blank page and
renaming the forms "theForm1" and "theForm2" (as well as the javascript
calls) which can be seen here:
http://www.atomicindustries.co.nz/evolt/atomicmedia.html
(original: http://atomicmedia.net/am/fontcart35.htmlx)

All broken images and no stylesheet or other prettiness but oh well...
you'll probably still have to tune it to get what you want but at least it
doesn't give an error. Hope that helps.

Shannon






More information about the thelist mailing list