+ 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()"?
1 Resposta
+ 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())