If you ask "why is it good or bad", I 'd like to share my opinion. When I write code, it usually causes errors with onsubmit = "Return myfunction ();" If your myfunction () method is incorrect during execution, the system returns true by default, so the form will still be submitted. Note: Will your check () be prone to errors when the code is running, such as JavaScript statements. In addition, if the browser disables javascript execution, the form will continue to be submitted. The second method you mentioned: <input name = "Submit" type = "button" onclick = "Return check () "Class =" button "value =" Submit "> it should be changed to this: <input name =" Submit "type =" button "onclick =" checkandsubmit () "Class =" button "value =" Submit "> checkandsubmit () means to check and submit the form: function checkandsubmit () {check code .... your form name. submit (); // submit form} has the following advantages: submit the form after the check is passed. If checkandsubmit has a syntax or other JavaScript error, no form will be submitted. However, the disadvantage is that if the browser disables JavaScript, the form cannot be submitted. However, normal Browsers Do not block JavaScript.
Onsubmit = "Return myfunction ();"