<form id="testForm">
<input type="button1" onclick="test(1)">
<input type="button2" onclick="test(2)">
</form><script>
    function test(value) {
        if(value == 1) {
             testForm.action = "a";
        }else {
             testForm.action = "b";
        }
    }
</script>