This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Conditional fields based on checkboxes and selects.

10 years ago

Hi there,

I’m trying to integrate the SiteOrigin Page Builder with my plugin and came across a problem. I’ve added a few fields to the row styles using the “siteorigin_panels_row_style_fields” filter found here: https://siteorigin.com/docs/page-builder/hooks/custom-row-settings/, but I can’t seem to use the state emitters and state handlers. Are these only available for the Widgets Bundle? And if that is the case, how can I target these fields in JS? I’ve tried binding a change event, but it never seems to work. Would I have to call this with an event? For example, if I wanted to do something like this:

$('select[name="style[test_field]"]').bind('change', function (e) {
  if( $(this).val() == 'option1' ) {
    $('input[name="style[second_field]').hide(500);
    $('input[name="style[third_field]').show(500);
  } else {
    $('input[name="style[second_field]').show(500);
    $('input[name="style[third_field]').hide(500);
  }
});

How would I achieve this? I would appreciate any feedback. Thanks!

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Have a different question or issue?

Start New Thread