/* Clean Form Validation was written from scratch by Marc Grabanski // http://marcgrabanski.com/code/clean-form-validation /* Under the Creative Commons Licence http://creativecommons.org/licenses/by/3.0/ Share or Remix it but please Attribute the authors. */ var cleanValidator = { init: function (settings) { this.settings = settings; this.form = document.getElementById(this.settings["formId"]); formInputs = this.form.getElementsByTagName("input"); // change color of inputs on focus for(i=0;i@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i return re.test(str); } // returns true if the string only contains characters 0-9 and is not null function isNumeric(str){ if(isRequired(str)) return false; var re = /[\D]/g if (re.test(str)) return false; return true; }