added js validation to register to allow validation before file upload.