On Nov 18, 2:24 am, Andrew Falanga wrote:
<snip>
Quote:
function displayFormElements(var form) {
<snip ^^^
That - var - in the function's parameters list is a fatal syntax error
(and any browser's javascript error reporting mechanism would have
reported it, if you had bothered to look).
Quote:
<form id="myForm" action="index.html" method="post">
<input type=text name="text1"></input>
<input type=button onClick="CheckForNull()" value="submit" />
This document is not XHTML (and could not be if you are using -
document.wirte - as XHTML DOMs mostly don't support its use) so the
use of XHTML style mark-up is inappropriate. But maybe it is worse
than inappropriate as the error correcting that will be applied to get
the above noise back to something that makes sense as HTML is quite
likely to result in differing DOM structures in different browsers
(error correction not being something that can be standardised).
For example, IE 6 thinks that the FORM element in the above document
has 6 child nodes, but change:-
<input type=text name="text1"></input>
- to the correct HTML of:-
<input type=text name="text1">
- and then IE only sees 5 child nodes of the FORM element.
<snip>
And if you are going to use XHTML style mark-up in your HTML documents
it really does not make any sense to mix it with HTML mark-up. The
closing tag of a P element may be optional in HTML (implied by
context) but in XHTML its handling must be explicit.