The arcane mysteries of the Javascript Document Object Model might seem
a bit arbitrary, but once it 'clicks', you realize you only need to
remember a few simple rules (plus a couple of exceptions... ;) ) and
then it's all quite straightforward.

Basically, pretty much everything is an object with properties and
methods
There are some standard properties and methods that every object has - I
recommend you learn these - and then some objects have specific
properties and methods in addition to these.

The model is hierarchical - the browser has windows, each window has a
document, each document has a head and body, etc etc. 

Every tag - and therefore every form field - is an object, with
properties. Every tag attribute is a property of the corresponding
object. Hence, <input type="text" name="myTextBox" value="blart" />
creates an object which has properties called type, name, and value.

One handy tip is that if you have a long reference to an object - e.g.
document.forms[1].mySelectBox - you can shorten it with a local copy of
the object :

objTheSelectBox = document.forms[1].mySelectBox;

which simplifies your syntax, AND it will usually be faster to execute.

As I said, there are a couple of exceptions to the above rules, but
don't worry about them unless you have to. 


References:

Mozilla / Gecko 
http://www.mozilla.org/docs/dom/

Internet Explorer
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
/reference/dhtml_reference_entry.asp


Hope that helps,

Alistair Davidson
Senior Technical Developer
Headshift.com
Smarter, Simpler, Social

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: 27 May 2004 11:18
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] OT- Javascript form


Matt, you're a GOD!

I don't understand why .value caused it to NOT work but hey its working
now...

Many thanks to all who helped on this one it gave me nightmares last
night.
(The JavaScript monster was going to get me)

This proves to me that javasscript.this.that.theother really  is a rule
unto itself....

ATTN Management email spies - I need a cool residential three week all
expenses paid JavaScript Course.

Thanks All

Regards - Paul




************************************************************************
*************************
The information contained within this e-mail (and any attachment) sent
by Birmingham City Council is confidential and may be legally
privileged. It is intended only for the named recipient or entity to
whom it is addressed. If you are not the intended recipient please
accept our apologies and notify the sender immediately, or telephone
+(44) 121 303 6666. Unauthorised access, use, disclosure, storage or
copying is not permitted and may be unlawful. Any e-mail including its
content may be monitored and used by Birmingham City Council for reasons
of security and for monitoring internal compliance with the office
policy on staff use. E-mail blocking software may also be used. Any
views or opinions presented are solely those of the originator and do
not necessarily represent those of Birmingham City Council. We cannot
guarantee that this message or any attachment is virus free or has not
been intercepted and amended.

************************************************************************
*************************


-- 
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF
provided by activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by
proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by
gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]



--
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to