form validation and javascript objects