I am learning Javascript and this might be a very stupid question but I am running nuts. I was trying all sort of things to prevent a form to be submitted with no luck so now I placed a very simple function that will always return false. Still the form is submitted, can someone explain why and what do I need to change? THANKS!
<form action="http://students.open.ac.uk/mct/tt284/reflect/reflect.php" method="post" name="displayTimeTable" onsubmit="return toSubmit();">
<some html>.....
<input type="submit" id="submit" name="submit" value="Submit" />
`
and the javascript
function toSubmit(){
alert('I will not submit');
return false;
}
<form>tag using</form>??