There is a form with a validation check function.
As soon as you clicked send, the function is triggered and finds the wrong field. The user is informed about this in the form of a pop-up window, the value can also be changed there.
After that, it turns out that you need to return false on the validator and click the send button again. Even if we update the data in the required field - for the form they still remain the same and this is logical.
Is it possible to somehow update the data for the form at this stage?
Code for example:
<form onsubmit="return valid();"> <input name="test" id="test1"> <input type="submit"> </form> <script> function valid(){ validVar = true; if($('#test1').val()==1)){ $('#test1').val(2); } return validVar; } </script> Such a code will be sent to form 1, if entered 1, how to send 2?