diff --git a/src/core/drive/form_submission.ts b/src/core/drive/form_submission.ts index 7c31ad53c..460c9ba0e 100644 --- a/src/core/drive/form_submission.ts +++ b/src/core/drive/form_submission.ts @@ -80,9 +80,12 @@ export class FormSubmission { get action(): string { const formElementAction = typeof this.formElement.action === "string" ? this.formElement.action : null - return ( - this.submitter?.getAttribute("formaction") || this.formElement.getAttribute("action") || formElementAction || "" - ) + + if (this.submitter?.hasAttribute("formaction")) { + return this.submitter.getAttribute("formaction") || "" + } else { + return this.formElement.getAttribute("action") || formElementAction || "" + } } get body() { diff --git a/src/tests/fixtures/form.html b/src/tests/fixtures/form.html index 30eb182dd..35f958dea 100644 --- a/src/tests/fixtures/form.html +++ b/src/tests/fixtures/form.html @@ -94,6 +94,11 @@