Skip to content

Instantly share code, notes, and snippets.

@d-baker
Created February 4, 2015 11:25
Show Gist options
  • Save d-baker/37fd73c7efbe7a2cda92 to your computer and use it in GitHub Desktop.
Save d-baker/37fd73c7efbe7a2cda92 to your computer and use it in GitHub Desktop.
notes to self re. the onsubmit attribute
  • don't forget the return: it's onsubmit="return someFunction()" not onsubmit="someFunction()"
  • if you are relying on an external javascript file to provide someFunction(), the function mustn't be wrapped in anything else. this means, no $(document).ready() or the like. as a result, the external script needs to go just before the closing </body> tag rather than in the <head> in order for everything to load in the right order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment