Generic Form Validations using Javascript