Support » Plugin: Contact Form Email » Custom Javascript callback JS

  • Resolved tabular

    (@tabular)


    Hi there,

    first of all thank you for the plugin. Helped a lot.
    I still have a major question.
    In the Plugin exists a field for “Custom Javascript” which gets invoked with the rendering of the plugin.

    Does there exist a way to run this custom javascript AFTER the JS of the Plugin itself is run?

    I need to manipulate some of the attributes of the fields in the form. Therefore I need my JS to run after the form is rendered by the Plugin.

    Best Regards

    • This topic was modified 1 year ago by tabular. Reason: added Tags
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    We have just published a plugin update (version 1.3.03) that improves that customization option.

    Now the script is loaded after jQuery and the main form script and there is also a new event support to know when the form has been rendered and is ready to be used.

    The event is the following:

    jQuery(document).one('showHideDepEvent', function(){
        (function($) {
           // place your code here
        })(jQuery); 
    });

    So, if you need – for example – change the value of a field you can use a code like this one:

    jQuery(document).one('showHideDepEvent', function(){
        (function($) {
            $("#fieldname1_1").val("hello world");
        })(jQuery); 
    });

    Hope that helps.

    Thank you for using the plugin!

    • This reply was modified 1 year ago by codepeople.
    Plugin Author codepeople

    (@codepeople)

    I forgot to add, remember to clear the browser cache after updating the script, in most cases the browser and/or WordPress cache plugins will keep a cached copy of it.

    Thank you!

    tabular

    (@tabular)

    Thank you very much. I will test the solution today and will reply.

    tabular

    (@tabular)

    Thank you very much. I just tested your solution and it works like a charm.

    good job!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Javascript callback JS’ is closed to new replies.