• Resolved krohmi

    (@krohmi)


    Hello, first things first, very nice and usefull plugin.

    And question is:
    How can i include script with my own functions. For example to read value of field and display it or add to href link.

    When i include separate js file i got error: “Uncaught ReferenceError: [eg. class} is not defined”. How can i properly include another js to read values from fields. Any tips would be usefull.

    Thx

    https://wordpress.org/plugins/calculated-fields-form/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    To include a new javascript file, you simply should upload it in the following location:

    /wp-content/plugins/calculated-fields-form/js/fields-public

    The plugin includes dynamically in the public webpage, all javascript files of this directory.

    Best regards.

    Thread Starter krohmi

    (@krohmi)

    That was blazzing fast 🙂
    But have some more questions…
    I placed js file in that location, js included well (i checked by placing alert box for testing).
    But when i trying to target fields nothing happens.

    Just one line of code:
    jQuery(‘.className’).hide();

    No offect…

    Thread Starter krohmi

    (@krohmi)

    Found a solution, just adding:
    $(document).ready(function()
    do the trick.

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

The topic ‘How to include another javascript’ is closed to new replies.