diff --git a/packages/forms/src/components/WebForms.astro b/packages/forms/src/components/WebForms.astro index ed594fe..c08d8ca 100644 --- a/packages/forms/src/components/WebForms.astro +++ b/packages/forms/src/components/WebForms.astro @@ -35,14 +35,25 @@ const clientScript = Astro.locals.forms.scriptToRun; diff --git a/packages/forms/src/form-tools/events.ts b/packages/forms/src/form-tools/events.ts index f27cd88..e24a77c 100644 --- a/packages/forms/src/form-tools/events.ts +++ b/packages/forms/src/form-tools/events.ts @@ -1,5 +1,6 @@ export function addOnSubmitClickEvent(buttonId?: string | false, allProps?: {[key: string]: string}){ if(buttonId){ - allProps.onkeypress = `__CSEvent(event, '${buttonId}');${allProps.onkeypress ?? ''}`; + allProps["data-submit"] = buttonId; + allProps.onkeypress = `__enterToSubmit(event)${allProps.onkeypress ? ';' + allProps.onkeypress : ''}`; } } \ No newline at end of file