how to set form value before submit with javascript code example Example: javascript onsubmit change input value document.getElementById("form_id").submit();