Skip to content

Instantly share code, notes, and snippets.

@peerax
Created March 10, 2015 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peerax/0beb7d431917596db63b to your computer and use it in GitHub Desktop.
Save peerax/0beb7d431917596db63b to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript">
function validateMyForm()
{
if(1 == 6)
{
alert("validation failed false");
returnToPreviousPage();
return false;
}
alert("validations passed");
return false;
}
</script>
</head>
<body>
<form name="myForm" onsubmit="event.preventDefault(); validateMyForm();">
<input type="text"/>
<button type="submit"> GO </button>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment