Initialize custom form component
I have a custom component that has a script for initializing the field, setting up the DOM for the field.
I want this field to be hidden by default, but I noticed it's not present in the DOM before it becomes visible.
Is there a way to either call the javascript function when it becomes visible, or have the field be present in the DOM?
3 Replies
Probably via Alpine
x-data x-init="your JS"
Thanks. I'll give it a shot
Thanks again, that's exactly what I was looking for.