<button type="button" onclick="addPOSTvar(this, [ ['name1' , 'value1'] , ['name2' , 'value2'], ['name3','value3'] ])">Кнопка для 3 переменных</button>
function addPOSTvar(context, params ) {
var form = $(context).closest('form');
form.append($.map(params, function (param) {
return $('<input>', {
type: 'hidden',
name: param[0],
value: param[1]
})
}));
form.submit();
}