Scott said:
I think it was your assumption that the OP was using an XHTML doctype
that started the confusion and then your misunderstanding of Garrett's
objection that extended it.
On which parts the misunderstandings were, remains to be seen.
You were the only one talking about your proposed alternative code;
everyone else, as I understand it, was talking about the OP's code.
Check again.
Can you justify your assumption that the OP was trying to use XHTML?
Yes.
The fragment supplied would not be valid in either HTML 4.01 or XHTML
1.0 documents
Wrong, see below.
but if the form controls were wrapped in a block element, then it would be
a valid fragment of an HTML 4.01 document but not of a an XHTML one.
True. The problem here is that the original code --
<form onsubmit="return false;" action="[action]" method="post">
<textarea name="myText" cols="30" rows="3"></textarea>
<input type="button" name="button" value="Value2"
onClick="this.form.submit();"/>
<input type="button" name="button" value="Value2"
onClick="this.form.submit();"/>
</form>
-- does not make a lot of sense to begin with, so all of us are left with
assumptions what it is supposed to be. One assumption, from which, if
accepted, could be deduced anything, which would not result in a fruitful
discussion, should therefore be excluded from the start: That the OP just
made an accidental typo, or used completely different code. We must
therefore also exclude that "[action]" was anything else than a marked
omission.
Given those premises that leaves the following valid alternative
assumptions:
A) The `onClick' indicates that this is supposed to be HTML. In that case,
it can be Valid HTML 4.01 Transitional, although the output might not
look as expected (if there was a user agent that parsed it strictly,
there would be `>' displayed). It could be made HTML 4.01 Transitional.
B) The `/>' indicates that this is supposed to be XHTML. Then it could be
Valid XHTML 1.0 Transitional were it not for "onClick" instead of
"onclick". It could be made XHTML 1.0 Strict with more changes.
Facing these alternatives, I have applied that scientific principle known as
Occam's Razor, which says in essence that the simplest explanation is
usually the correct one. The Levenshtein distance of the original fragment
to a Valid HTML 4.01 Transitional fragment is 0, to a Valid HTML 4.01 Strict
fragment --
<form onsubmit="return false;" action="[action]" method="post">
<p><textarea name="myText" cols="30" rows="3"></textarea>
<input type="button" name="button" value="Value2"
onClick="this.form.submit();"/>
<input type="button" name="button" value="Value2"
onClick="this.form.submit();"/>
</form>
-- it is greater than or equal to 3, to a Valid XHTML 1.0 Transitional
fragment --
<form onsubmit="return false;" action="[action]" method="post">
<textarea name="myText" cols="30" rows="3"></textarea>
<input type="button" name="button" value="Value2"
onclick="this.form.submit();"/>
<input type="button" name="button" value="Value2"
onclick="this.form.submit();"/>
</form>
-- it is 2, and to a Valid XHTML 1.0 Strict fragment --
<form onsubmit="return false;" action="[action]" method="post">
<p><textarea name="myText" cols="30" rows="3"></textarea>
<input type="button" name="button" value="Value2"
onclick="this.form.submit();"/>
<input type="button" name="button" value="Value2"
onclick="this.form.submit();"/></p>
</form>
-- it is greater than or equal to 9. Considering interoperability in
addition to validity, HTML 4.01 Transitional would score at least 2, while
HTML 4.01 Strict would score at least 9. (The *lowest* score wins here.)
That leaves HTML 4.01 Transitional (0 or 2) and XHTML 1.0 Transitional (2)
as the most likely candidates. Assuming that a newcomer writing such code
would have at least heard about XHTML, given the number of occurrences in
the past where newcomers posted (often invalid) markup with SHORTTAG
syntax that turned out to be supposed to be XHTML, and that the OP used
`onsubmit' where it could have been, for consistency, `onSubmit' in HTML,
I decided that it would be best if I posted my suggestion as an XHTML 1.0
Transitional fragment.
In any case, Garrett's assumption that this might be XHTML 1.0 Strict is,
given these numbers, less likely than all the alternatives except
interoperable Valid HTML 4.01 Strict. And his criticism of my XHTML 1.0
Transitional suggestion is inconsistent with his assumption (in the very
same posting!) that the OP did not want to use XHTML at all.
BTW, Garrett's assumption that Eric changed the code was unjustified, too.
Eric merely quoted my suggestion as quoted by Garrett before, but he removed
the relevant attribution lines.
So much for confusion. EOD?
PointedEars