statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
31 stars 1 forks source link

Set site in form submission #992

Open NeoIsRecursive opened 1 year ago

NeoIsRecursive commented 1 year ago

Would be nice to be able to set the site/lang the validator should use in the request when submitting.

We use Statamic headlessly and because of that the form is always validated in the default sites lang/locale, which is not what we want.

Example of solution

    fetch('some-statamic-form', {
        method: 'POST'
        headers,
        body: {
           ...data,
           site: 'swedish'
        }
    })

Would use the swedish sites locale when validating the form