This might help you.
<form id="myform" action="action.php">
<input type="hidden" name="myinput" value="0" />
<input type="text" name="message" value="" />
<input type="submit" name="submit" onclick="save()" />
</form>
<script>
function save(){
$('#myinput').val('1');
$('#form').submit();
}
</script>