"Frank" <fs******@hotma il.co> wrote in message
news:40******** *************@n ews.inter.NL.ne t...
Does anyone know why this doesn't seem to work on certain
browsers / versions?
<form name="formulier " action="script. cgi" method="post">
<a href="#" onClick="docume nt.formulier.su bmit()"><img
src="button.gi f" border="0" ></a>
</form>
Lots of possible reasons:-
1. JavaScript disabled/incapable browsers will not execute the onclick
attribute code at all.
2. The onclick code does not cancel the navigation so if the form has
not been submitted (actually sent) when the navigation specified in the
HREF occurs the browser might be assuming that the user has changed
their mind and stop/cancel the submit to act on the user's second
request (as there is no longer any need to display the result of the
form submission, so why bother sending it).
3. The browser is not making references to named form objects named
properties of the document object (there are no standards that say they
should) so the reference is not being resolved to the form and instead
is generating a JavaScript error.
4. Something else resulting form mark-up or JavaScript not shown above.
But the design is stupid as submitting a form by clicking on an image is
easily achieved using an <input type="image" ... > element. Requiring no
JavaScript at all.
Richard.