rguliev / conditionize2.js

jQuery plugin for conditioning things
https://rguliev.github.io/conditionize2.js/demo/index.html
MIT License
22 stars 6 forks source link

Ability to scope conditionize #16

Open Alexplose opened 2 years ago

Alexplose commented 2 years ago

I have multiple forms within modals that have have input with same (name/id).

Is it possible to scope conditionize to a specified form.

 $("#eventForm [data-condition]").conditionize({
                                            scope:"#eventForm",
                                            ifTrue: function ($s) { $s.removeClass('d-none'); },
                                            ifFalse: function ($s) { $s.addClass('d-none'); }
                                           });

Or any workaround ?