Javascript form validation cleanup