Home>Support>Hiding/showing fields with admin events

Hiding/showing fields with admin events

By C, 7 months ago. Last reply by Alex S, 6 months ago.

Hi,

I’m trying to hide/show fields depending on the options selected.

Referring to this thread I added the following:

window.addEventListener("load_panels_data", function() {
    console.log("Panels data loaded");
});

But nothing was logged.

Any thoughts?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 months, 24 days ago Alex S
    Hi, I Work Here

    Hi C,

    Thanks for reaching out. The load_panels_data is Page Builder specific, and fires before you can really change how the form visually looks. Instead, I recommend using the sowsetupform event. This will trigger when setting up the form, and allow you to filter the fields as needed. You’ll need to use JavaScript to hide the fields.

    Another option would be to set up a custom state emitter.

    Kind regards,
    Alex

  2. 6 months, 29 days ago C

    Hi Alex,

    Apologies for the delay, only just getting back to it.

    Thanks very much, that looks like it’ll do the trick.

    Kind regards,
    C

  3. 6 months, 28 days ago Alex S
    Hi, I Work Here

    Hi C,

    It’s great to hear that helped. :)
    Please feel free to open a new thread if anything else comes up.

    Kind regards,
    Alex

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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More