javascript know form is submitted or not code example
Example 1: js form submit listener
document.getElementById("#myFormId").addEventListener("submit", function(e){
if(!isValid){
e.preventDefault(); //stop form from submitting
}
//do whatever an submit the form
});
Example 2: how to access values from a form event callback
<form_instance_or_returned_event_on_callback>.elements[0].value