<form action="bogus" method="post">
<p>
<a href="prev.cgi"><input type="submit"
name="prev" value="< Back"></a>
<a href="next.cgi"><input type="submit"
name="next" value="Next >"></a>
</p>
</form>
A person who have tried to use the above structure is citing the
HTML spec about what is supposed to happen when the submit button is
pressed
<http://www.w3.org/TR/REC-html40/interact/forms.html#idx-form-12>:
Finally, the encoded data is sent to the processing agent designated
by the action attribute using the protocol specified by the method
attribute.
According to the HTML spec: "Nested links are illegal"
<http://www.w3.org/TR/html401/struct/links.html#idx-link-6>. But in
the given example there are no nested links. There's a form button
nested in a link and (at least) I haven't found section in the spec
which explicitly forbids this or at least states this would have
undefined behavior. So is the example permissible and the behavior
defined?
The man has particularly mentioned the difference in the behavior in
IE and Mozilla/Netscape. IE does submit the form and Netscape
follows the link. He thinks Mozilla/Netscape behaves non-standard
compliant in this case. I'm pretty sure this is more omission in the
HTML spec and the behavior is pretty much undefined. Again, what
should be the standard compliant behavior in the given case?
Further, I've made the following test using javascript:
<a href="prev.cgi" onclick="return false"><input
type="submit" name="prev" value="< Back"></a>
IE ceases to submit the form although the event (I think) shouldn't
reach the link 'A' element. The event should be processed in the
same way as if there was no 'onclick' on the link element.
--
Stanimir