E
Evertjan.
Misusing the reset-button into submission is fun
<form onreset='this.submit()'>
is enough.
Changing the action-url is easy:
<form
onreset='this.action="another.html";this.submit()'
However detecting which button was pressed
takes some more action:
===============
<script type='text/javascript'>
function which(t) {
t.form.whichButton.value=t.value;
};
</script>
<form
onsubmit='this.action="a.html";'
onreset='this.action="b.html";this.submit()'<input name='z'>
<input type='submit' value='submit 1 to a' onclick='which(this);'>
<input type='submit' value='submit 2 to a' onclick='which(this);'>
<input type='reset' value='submit 1 to b' onclick='which(this);'>
<input type='reset' value='submit 2 to b' onclick='which(this);'>
<input type='hidden' name='whichButton'>
</form>
===============
Chrome on pc tested, not chrome-beta for Ice Cream Sandwich.
<form onreset='this.submit()'>
is enough.
Changing the action-url is easy:
<form
onreset='this.action="another.html";this.submit()'
However detecting which button was pressed
takes some more action:
===============
<script type='text/javascript'>
function which(t) {
t.form.whichButton.value=t.value;
};
</script>
<form
onsubmit='this.action="a.html";'
onreset='this.action="b.html";this.submit()'<input name='z'>
<input type='submit' value='submit 1 to a' onclick='which(this);'>
<input type='submit' value='submit 2 to a' onclick='which(this);'>
<input type='reset' value='submit 1 to b' onclick='which(this);'>
<input type='reset' value='submit 2 to b' onclick='which(this);'>
<input type='hidden' name='whichButton'>
</form>
===============
Chrome on pc tested, not chrome-beta for Ice Cream Sandwich.