jQuery-dependant Javascript form validation