Skip to content

Form submit with custom events is missing property of the submit button itself #5050

@linjmeyer

Description

@linjmeyer

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for self-hosted support

Using official Plausible Cloud hosting or self-hosting?

Self-hosting

Describe the bug

I have a get request in a form, where one of the expected params is provider and the value is the button that is clicked. The form works as expected when no event class is present, but if I add one the form submission is missing the provider param from the clicked button. There is also two hidden elements, returnUrl and __RequestVerificationToken which are always present in either case. The only one missing is the button's value.

here is an example of the form:

<form method="post" class="plausible-event-name--user-login-or-signup" action="/user/login">
    <input type="hidden" name="returnUrl" value="/return/url/example">
    <input type="hidden" name="__RequestVerificationToken" value="super-secret-token-value">
    <button type="submit" name="provider" value="Google" title="Log in using your Google account">
    Login With Google
    </button>
    <button type="submit" name="provider" value="Apple" title="Log in using your Apple account">
    Login With Apple
    </button>
</form>

I suspect it is because plausible is capturing the submission via button click, stopping it, then re-submitting it via element.submit() or element.requestSubmit() but I am not sure.

Expected behavior

The button's value won't omitted when the form is submitted via a click on a particular button.

Screenshots

No response

Environment

- OS: Windows
- Browser: Chrome
- Browser Version: 132.0.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions