return validate - JavaScript | Sololearn: Learn to code for FREE!

+2

return validate - JavaScript

<form onsubmit="return validate()" method="post"> Number: <input type="text" name="num1" id="num1" /> <br /> Repeat: <input type="text" name="num2" id="num2" /> <br /> <input type="submit" value="Submit" /> </form> Why are we using "return" here and why not just "validate()"?

8/25/2020 5:42:40 PM

Bishwajit Khanra

1 Answer

New Answer

+1

You apply for a job in a company You submit your details to the company The company receives and do the certain validation and THEN RETURN YOU WHETHER You ARE SELECTED OR NOT (in this case validate())