2

I have a jquery script that will allow todays date to autopopulate the Date form tag in contact form 7 plugin. This is not a function that CF-7 can do without a script. I don't want my users to have to fill out the date field every time they log in.

I've got as far as knowing I need to install the script into a js directory and to call it in the plugin, but I don't know which directory!

I have a js directory in WP-Admin, one in WP-content/plugins/includes/contact-form7/js, and there is a js directory in WP-Includes.

I am using WP version 4.0.44

Here is the code I want to add, it is called "todays_date":

$(document).ready(function(){
    var date = new Date();
    $("#dates").datepicker({
        dateFormat: 'd-M-y'
    }).datepicker('setDate', date);
}. 

Thank you for any help. I've looked all over and can't find an answer that will help a complete newbie (to both WP and jquery) like me. I posted on the CF7 forum and got no answer. I did check this forum first but nothing specified doing this to customize a plugin.

Knowing how to add jquery scripts to plugins to perform functions the plug in cannot do will open up a lot of doors for me.

Thank you for any help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.