JavaScript on widget not working on page builder
Hi, I build a widget for my theme that includes a dropdown and several checkboxes. When the value in the dropdown changes, it checks and unchecks some boxes depending on some default values for that option. This change is made on the fly with jQuery.
It works fine if I add the widget to a regular sidebar in the widgets page, but when I add it to a page using the page builder, the checkboxes don’t change. Are there any particular requirement to get js to work in the widgets with the page builder?
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
2Nevermind, figured it out. In case anyone has the same issue:
I had my selector in jQuery set to:
$( ‘#widgets-right select.select_style’)
which is required or everything to work correctly in the the widgets admin area, just add a selector without the #widgets-right part:
$( ‘#widgets-right select.select_style, select.select_style’)
Hi Oscar
Thanks for sharing your fix, glad to hear you got it resolved.
All the best.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.