Hi, I have a datepicker in which I want to disable some dates, in particular all the months excluding january, february, march and april.
I found this reference hidden link
And I want to change it to work with months.
What I don't know is where to put the code etc
If the datepicker is in a View, you can add the raw JavaScript code to the View editor's JS panel. If the datepicker is in a CRED form, you can add the raw JavaScript code to the CRED editor's JS panel. The JS code will then be included on any page containing that View or CRED form. Did you need to use PHP to output the JavaScript in the page source for some other reason?
A few notes:
- In a View, you can use the document ready event handler to invoke your custom code. The jQuery object can be accessed using jQuery instead of $.
jQuery(document).ready(function(){
// your view jquery code here using jquery instead of $
});
- In a CRED form, document ready happens too soon. You should wait for the 'cred_form_ready' event to be fired on the document object:
jQuery(document).on('cred_form_ready', function() {
// your cred form jquery code here using jQuery instead of $
});
No, it isn't in a view or cred, it is a Contact Form 7.
I'm not a coder and in particular I have no skills with javascript and the only place I saw in WordPress to put some js code wan in Toolset Views.
But probably I'd better have to put it into functions.php but I don't know how so I don't know how to disable some months other way.
It sounds like you need assistance programming some custom validation on a form that is not a CRED form. Contact Form 7 is not Toolset software, and I'm not really qualified to help you set up custom validation on their forms. If you have a question about how this should be implemented, Contact Form 7 is best suited to help you with that. hidden link