Skip to content

Commit

Permalink
68 Fix form submitting
Browse files Browse the repository at this point in the history
  • Loading branch information
tdziezykDS committed Nov 30, 2023
1 parent ef06141 commit 60b953b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/v2-forms/forms/event-notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const formContent = `
<div class="${formName}__buttons">
<button class="button primary" type="submit">${getTextLabel('event-notify:notify')}</button>
<button class="button secondary ${formName}__add-event-button">${getTextLabel('event-notify:add-event')}</button>
<button type="button" class="button secondary ${formName}__add-event-button">${getTextLabel('event-notify:add-event')}</button>
</div>
`;

Expand Down Expand Up @@ -71,6 +71,8 @@ export const onSubmit = async (form, handleSubmit) => {

if (form.checkValidity()) {
await handleSubmit(form);
} else {
form.querySelector('button[type="submit"').removeAttribute('disabled');
}
};

Expand Down

0 comments on commit 60b953b

Please sign in to comment.