Set cookie with form values before submit

Use jquery cookie plugin.


<script>
  $('#formid').submit(function(e) {
    var field = $('#fieldid').val();
    $.cookie('field', field, { expires: 1, path: '/' });  
  });
</script>