VK wrote on 01 jun 2008 in comp.lang.javascript:
This is not always true, VK, try this:
<form onSubmit="some_var = 'validated';" target='_blank' ...
And could be usefully used like this:
==========================================
<form onSubmit="return submitOnlyOnce()" target='_blank' ...
<script type='text/javascript'>
var submitted = false;
function submitOnlyOnce() {
if (submitted) return false;
return submitted = true;};
</script>
==========================================
You missed the point: of course the intrinsic event handler can be
most useful. I explained that one cannot have two unrelated blocks in
both DOM interface handler and in intrinsic handler: one will be
ignored, namely the intrinsic one.
Doesn't work:
....
document.forms[0].onsubmit = validate;
....
<form ... onsubmit="some_var='value';/* will be ignored */">
Workaround 1:
document.forms[0].onsubmit = function() {
some_var='value';
return validate(this);
}
Workaround 2:
<form ... onsubmit="some_var='value'; return validate(this);">
If some_var is indeed some additional "submission allowed" flag then
it could be even:
<form ... onsubmit="return some_var : validate(this);">
There is a number of other options but nothing of what OP was trying
to do: it is simply not supported.