p(error => error["message"]).join(", ");
                    } else {
                        status.innerHTML = "Oops! There was a problem submitting your form";
                    }
                })
            }
        }).catch(error => {
            fields.forEach(field => {
                field.removeAttribute("disabled");
            });
            status.innerHTML = "Oops! There was a problem submitting your form";
        });
    }

    function getMessage(field) {
        const validity = fie