[thelist] javascript - how to refer to (x)html elements

Jeff Howden jeff at jeffhowden.com
Wed Nov 12 00:24:44 CST 2003


tim,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Tim Burgan
>
> as i've been trying to learn JavaScript - i'm a little
> stuck.. again
>
> I don't know how to explain this, but instead of:
>
>   document.formName.inputName.value
>   (eg. <form name="example"> <input name="example">)
>
> i want to use:
>
>   document.formId.inputId.value
>   (eg. <form id="example"> <input id="example" />)
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

don't.  there's no reason whatsoever to not use dom0 access methods.  use
the forms and elements collections for their intended purpose.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> the reason being, that to use the first example I must
> use non-standards-compliant xhtml code in my documents.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

that's bullshit.

sure, forms can't have a name attribute in xhtml, but not form fields.  they
*must* have a name attribute if you want the data to be submitted to the
server.

rethink your approach please.

thanks,

.jeff

——————————————————————————————————————————————————————
Jeff Howden - Web Application Specialist
Résumé - http://jeffhowden.com/about/resume/
Code Library - http://evolt.jeffhowden.com/jeff/code/



More information about the thelist mailing list