updated field validation and added name attributes for form submission