Thanks for your advice Thomas...
[Quoting repaired]
> [Thomas 'PointedEars' Lahn wrote:]
>> ISTM it is your using Google Analytics at the end of the `body' element (and
[quoted text clipped - 3 lines]
> Actually I have placed the Analytics tag exactly where Google say to
> put it
You misunderstood me. I did _not_ mean to say that the position of the
"Analytics tag", which is rather a `script' element containing a call to
Google Analytics code, was wrong. Mentioning the position was merely a way
to point you directly to the line where the problem appears to occur.
> and the validator code seems strict xhtml
Parse error. *Your* code is _not_ valid.
http://validator.w3.org/check?verbose=1&ss=1&uri=http%3A%2F%2Fwww.wildwoodbushcr
aft.com%2Fvoucherformtest.htm%3Fcourse_name%3DBushcraft%2BWeekend%2Bcourse%26pri
ce_code%3DSWC
shows 12 errors, and that is assuming HTML 4.01 Transitional because you
omitted the required DOCTYPE declaration in your code.
> and I am not sure why it would create this error as other pages with
> transitional or loose syntax and also Analytics tags in the same place
> do not give the error...
Would that not be an indication that Google Analytics, at least the way you
used it, does not work with XHTML?
> perhaps I am missing something here but I am still not sure how to progress.
Use Valid HTML 4.01, preferably Strict.
Please take heed on the FAQ on how to quote properly:
http://www.jibbering.com/faq/faq_notes/clj_posts.html#ps1Post
PointedEars

Signature
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
redog6@hotmail.com - 25 Oct 2007 21:57 GMT
I have now updated the page to conform to valid html 4.0 Transitional
but the error still persists.
Evertjan. - 25 Oct 2007 22:01 GMT
wrote on 25 okt 2007 in comp.lang.javascript:
> I have now updated the page to conform to valid html 4.0 Transitional
> but the error still persists.
What error?
[please always quote on usenet, this is not email]

Signature
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
redog6@hotmail.com - 26 Oct 2007 10:52 GMT
> wrote on 25 okt 2007 in comp.lang.javascript:
>
[quoted text clipped - 9 lines]
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Sorry, I was talking about the original error "'undefined' is null or
not an object". I have taken earlier advice which suggested that the
Javascript for my Google analytics combined with invalid mark up may
have been causing the error but although it may relate to another
error on validating the page and even removing the Analytics
javascript the "'undefined' is null or not an object" error still
persists. I am not surprised since other pages with the same invalid
markup and Analytics tags do not produce the error.
David Mark - 26 Oct 2007 11:38 GMT
On Oct 26, 5:52 am, red...@hotmail.com wrote:
> > wrote on 25 okt 2007 in comp.lang.javascript:
>
[quoted text clipped - 18 lines]
> persists. I am not surprised since other pages with the same invalid
> markup and Analytics tags do not produce the error.
Here are some problems:
var pfname, cemail, psurname, p_email, vvouchertype, vcoursedate,
vvoucher_email;
with(window.document.msgform)
{
pfname = purchaser_firstname;
cemail = purchaser_email;
psurname = purchaser_surname;
pemail = purchaser_email;
vvouchertype = voucher_type;
vcoursedate = course_date;
vvoucher_email = voucher_email;
}
There are so many things wrong with this, it is hard to know where to
begin. First, don't use a with clause unless you know exactly what
you are doing and have a good reason for doing it (it isn't needed
here.) Second, pemail is undeclared. Third, read the FAQ section
about form element access.
The exception occurs in your trim function. At some point you pass it
an undefined variable.
pr - 26 Oct 2007 13:24 GMT
> Sorry, I was talking about the original error "'undefined' is null or
> not an object". I have taken earlier advice which suggested that the
[quoted text clipped - 4 lines]
> persists. I am not surprised since other pages with the same invalid
> markup and Analytics tags do not produce the error.
Looks like vvouchertype.value to me.
http://www.jibbering.com/faq/faq_notes/form_access.html#faBut
shows you how to retrieve radio button values. Since the value of the
checked item is in the HTML, it's a puzzle as to why you should be
trying to trim it in any case.
I agree with David on the code quality: it's not a very obscure bug and
it's a worry that it takes so long to pinpoint it.
redog6@hotmail.com - 30 Oct 2007 12:29 GMT
> red...@hotmail.com wrote:
>
[quoted text clipped - 17 lines]
> I agree with David on the code quality: it's not a very obscure bug and
> it's a worry that it takes so long to pinpoint it.
Many thanks and also to David for your constructive comments - that
has solved the problem.
Thomas 'PointedEars' Lahn - 26 Oct 2007 13:39 GMT
>> [please always quote on usenet, this is not email]
JFTR: Quoting is useful with e-mail, too.
PointedEars