Skip to content

Allow set message to return a function #93

@KeironLowe

Description

@KeironLowe

It would be good to allow the message attribute on setMessage to allow a function so we have more freedom with our error messages. I'm trying to make the error messages match up with with the errors returned by the server. For example, Laravel returns the following error for a missing field The :attribute field is required. with :attribute being replaced with the name of the field.

So something like...

hyperform.setMessage(element, 'valueMissing', (el) => `The ${el.name} field is required.`);

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