<? if (....): ?>
....
<? endif: ?>
<? else: ?>
<? if (....): ?>
....
<? else: ?>
....
<? endif ?>
<form action="" name="test_form">
<input type="text" value="1" name="test" />
<button value="button_1_value"> button_1 </button>
<button value="button_2_value"> button_2 </button>
</form>
$(document).ready(function(){
$('form').find('button').on('click', function(event){
event.preventDefault();
msg = $(this).parent('form').serialize();
$('div').html(msg + " " + $(this).val());
});
});