Closed authapi closed 11 years ago
The only element I can think of you'd want to disable conditionally is the select dropdown right? The disableCustom
prevents the custom select from ever being created, but, when it is created the custom select will have a class equal to the name of the original select. Ideal Forms doesn't remove the original element it just takes it out of view, this means that you can bring it back in place, hide the custom one and then apply a new plugin if you want. In other words, assuming your select is named "foobar":
$('.ideal-select.foobar').hide(); // hide replacement
$('select[name="foobar"]')
.css({ position: 'inherit', left: 0 }) // bring original back in place
.customSelectPlugin() // call another plugin
Note that I haven't tried this personally but I imagine it should work. Let me know how it goes.
The validation should work with most replacement plugins. The icon and error will still show but you'll need to adjust the width of your custom select and make sure it works in responsive mode. I tried once with select2 and I found it fairly easy to adjust to Ideal Forms
Thanks! I will try this and let you know..
Yes, this is for the select dropdown.
Works great! thanks again.
Great plugin!
I just found this and I was wondering if there's a way to disableCustom to certain classes instead of the whole element/tag inside the form.
I tried using disableCustom and it works, but I just need to disable it to a particular element say with a class and using another plugin with it's own styling/code and if possible use only the validation.