Вы можете использовать событие onSubmit
, как показано ниже -
<form action="test.php" name="testform" onSubmit="return TestDataCheck()" >
<input type="text" value="hello" name="testinput" />
<form>
Определить функцию, как показано ниже -
<script type="text/javascript">
function TestDataCheck(){
//Here do whatever you want to do with the form or it's values.
//I am changing the value of input field in the form for your reference in same way you
//can change any elements value.
$('input[name="testinput"]').val("bye");
return true.
}
</script>