<ra***@alum.mit.edu> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I would like to use a Form "button" (or "input", either one) within an
anchor, instead of using text or creating a graphic. This works fine
in all browsers but IE, but IE, while showing the correct URL in the
status line and the tooltip, DOESN'T initiate the link.
The code is essentially:
<a href="http://foo.com/whatever.htm">
<input type="button" value="Click Me"></a>
Works fine in Mozilla, Opera, etc., but not in IE. Any ideas?
Don
In answering the actual question you put, rather than questions you didn't
put, my suggestion is this:
Briefly, in the IE event model, events bubble upwards through the document
hierarchy. They are first received by the element upon which the event
occurred. If not handled, they bubble up through the hierarchy until they
are. There are ways to modify this behaviour.
In your code, the button is at the bottom of this branch of the hierarchy.
It recieves the click event, and being a button, handles it. The event does
not proceed up the chain to the anchor element; the link is not activated. A
button handles click events automatically, though, until an event-handler is
explicitly provided to it, does nothing with it.
NOW it is appropriate to ask why you are bothering to do it this way. As the
other posts suggest, use a button or a link. There is no need for both.
HTML-only solutions avoid the pitfalls of disabled script in client.
Laurence