Adding validation to the new layer form.