<form method="post">
<input type=button onclick="this.form.action='a.php';this.form.submit()" value='a.php'>
<input type=button onclick="this.form.action='b.php';this.form.submit()" value='b.php'>
</form>
<input type=button onclick="this.form.action='a.php';this.form.submit()" value='a.php'>
<input type=button onclick="this.form.action='b.php';this.form.submit()" value='b.php'>
</form>
<input type=button onclick="this.form.action='a.php'" value='a.php'>
<input type=button onclick="this.form.action='b.php'" value='b.php'>
</form>
似乎好些
<input type=button onclick="form.action='a.php';form.submit()">
<input type=button onclick="form.action='b.php';form.submit()">
</form>