Reactive() and rules()

I am using the standalone form builder as a search from (think filters) and currently all the fields are reactive(). I do though have some validation rules set on each field using rule() or rules() or even length(). The statePath() of the form is 'filters', so I am just using $this->filters get my array of currently applied filters. How should I go about ensuring that set of filters only includes validated data? I know live validation isn't supported, so wondering the best/most efficient way to go about it.
4 Replies
Dan Harrin
Dan Harrin2y ago
in the table builder, we dont actually validate we just use the raw data
Mark Chaney
Mark ChaneyOP2y ago
i dont really need validation, just thought i could use it as an easy way to not 'react' until validation is met. Simple things like min length or length(5) so zip code is searched until all 5 are entered, etc. I mean, partial zip searches are fine, but since i dont have an apply button and its live, im just trying to reduce the number of queries if possible. obviously could mix in some debounce, etc
Dan Harrin
Dan Harrin2y ago
yeah i think its tricker than you think cause you need to use some data to rerender the table with when validation fails and that old data is lost by that point
Mark Chaney
Mark ChaneyOP2y ago
well this has nothing to do with a table, but i get your point
Want results from more Discord servers?
Add your server