Auto assign AlpineJS' @input.debounce to 100+ input fields

I have some 100+ input fields which I am getting it stored in an AlpineJS global variable as Alpine.store('global_data', { ... })

Now I am saving this to data to localStorage on the click of a Save locally button.

Is there any way to do @input.debounce="saveLocally()" on all inputs without manually setting this to all of my 100+ inputs ?

shudder

I mean… ctrl-H, find “type=‘text’” (or whatever kind of input it is), and replace with the appropriate code? Doesn’t… really sound like a difficult task…?
Also, i’ve never used AlpineJS, but this sounds a lot like a call for a model?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.