<form action="http://javascript.ru" method="get">
<a href="#">param 1</a>
<a href="#" >param 2</a>
<input type="hidden" name="inp">
</form>
<script>
window.onload = function () {
document.forms[0].onclick = function (e) {
e = e || event;
var target = e.target || e.srcElement;
if (target.tagName == 'A') {
if (target == this.children[0]) {
this.inp.value = 1;
} else {
this.inp.value = 2;
}
alert(this.inp.value)
this.submit();
}
}
}
</script>