javascript insert form element before submit button to a form code example
Example: add parameter submit form javascript
$('#form').submit(function(eventObj) {
$(this).append('<input type="hidden" name="field_name" value="value" /> ');
return true;
});