 <pre><code> $(document).ready(function(){ $('input[name=subdomain]').keyup(subdomain_check); $('input[name=password]').keyup(password_strenght); $('input[name=c_password]').keyup(password_check); $('input[name=email]').keyup(email_check); function subdomain_check (e) { // these functions should set a global variable to false if validation fails } function password_strenght (e) { // these functions should set a global variable to false if validation fails } function password_check (e) { // these functions should set a global variable to false if validation fails } function email_check (e) { // these functions should set a global variable to false if validation fails } $(document).submit(function(e){ return global_var; // where global_var is the variable set by the validating functions } }); </code></pre>