Bart said:
Kelly said:
Can anyone tell me what I'm doing wrong here?
[...]
<html>
Missing doctype declaration.
^^^^^^^
See below.
The <script> tag was closed, with `>'. However, the `script' *element* was
[...]
document.EmailFound.CMName.value="Fanny";
[...]
[...]
For a better backwards compatibility, one could also use:
document.forms['EmailFound'].elements['CMName'].value
in stead of
document.EmailFound.CMName.value
Backwards compatibility is _not_ the reason why collections should be used
instead; both approaches are equally backwards-compatible. This is instead
about standards compliance: HTML collections are a specified Web standard
(per W3C DOM Level 2 HTML); shorthand references like these are not.
Not Valid, the required `action' attribute is missing.
See below.
Though not strictly required, this should be <input type="text"
name="CMName">.
Why? TEXT is the default value for the `type' attribute of the HTML INPUT
element, and `text' is the default value of the XHTML `input' element.
I know of no non-obsolete user agent that requires this default value to be
set explicitly for the element to be considered a text input control. Do you?
All together:
<!doctype HTML public "-//W3C//DTD HTML 4.01//EN"
"
http://www.w3.org/TR/html4/strict.dtd">
Strange, I thought SGML keywords are case-sensitive, i.e. "DOCTYPE". Is
this a (W3C) Validator bug not recognizing the error, or has there been a
(W3C) Validator bug before, that is now fixed, which marked the lowercase
version as such?
[...]
<body
onLoad="document.EmailFound.CMName.value='Fanny';">
Have you not just suggested the standards-compliant solution?
onload="document.forms['EmailFound'].elements['CMName'].value='Fanny';">
<form method="POST" name="EmailFound">
<input type="text" name="CMName">
<input type="submit" value="Submit">
</form>
This is, again, _not_ Valid HTML 4.01 Strict. The required `action'
attribute is missing and the inline-level `input' elements must be
descendants of another block-level element for this.
[...]
The 'onLoad' event handler is executed right after the page has fully
loaded.
The *value* of the intrinsic `onload' event handler _attribute_ is then
passed to the script engine and executed as a program by it.
Your signature delimiter has been broken by Google Groups; the necessary
trailing space was removed. I suggest not to use signatures with user
agents this broken. (Or, even better, not to use those applications for
posting at all.)
PointedEars