#Preserving state only when errors exist

1 messages · Page 1 of 1 (latest)

granite quiver
#

When using the form system, is it possible that Inertia will only preserve state when errors exist?

Something like..

function submitBid() {
    bidForm.post(route("auction.bid.store", { auction }), {
        preserveScroll: true,
        preserveState: bidForm.hasErrors,
        onSuccess: () => {
            bidForm.reset();
        },
    });
}

Mainly because I want it to fetch new data after submission, setting it to false works until an error exists.

hard kindle
#

Yeah, there's an example in the docs

granite quiver
#

Ahh it was under manual, I didn't realise, I was hunting the form page, thank you!!

#

Godsend

#

Also wow, this new forum system is so lovely, so much better