Targeting [Custom Javascript] code per Form

Home Forums Quform WordPress Targeting [Custom Javascript] code per Form

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  katw 1 day, 10 hours ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27146

    katw
    Participant

    Hi Ally,

    Is there a way to segregate the custom javascript on a form ID basis so only the javascript belonging to the particular form is loaded/linked?

    Have you got sneaky comment tags I can insert to mark “start and end” for each OR a filter hook I can tap into to override/change the JS file or content linked?

    I’m guessing no?

    So my thinking is I have two options:

    1. Remove all JS code from Custom Javascript field and use another plugin to load the JS in footer
    2. Add an IF/THEN check for presence of class quform-1 or .quform-form-1 around code for form one and similar idea for form 2.

    Any other suggestions/solutions?

    Thanks Kat

    • This topic was modified 5 days, 9 hours ago by  katw. Reason: added alternate class name
    #27171

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27193

    katw
    Participant

    Nice idea, thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.