See here .
You needed to define your validateForm function in a global scope in order to be able to use it in an HTML-like. Otherwise, you defined it as a function inside the onDomReady event onDomReady , which is not available outside this scope.
More "jQuery-ish" will use jQuery to handle the click event as follows:
$("#id_btnSubmit").click(validateForm);
See here for an example of this sentence.
source share