Skip Navigation

[Resolved] the Update to CRED 1.9 has prevented Jquery operating

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 15 replies, has 2 voices.

Last updated by Shane 6 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#544454

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Peter,

Thank you.

I checked the site and saw why it wasn't working, it needed a wrapper so that the code would run after the page finished loading.

Try this.

jQuery( document ).ready(function() {

var countCheckedTopics = function() {
var nTopics = jQuery( "div.cred-taxonomy-category input:checked" ).length;
if( nTopics >= 3 ){
jQuery( "div.cred-taxonomy-category input[type=checkbox]" ).not( ":checked" ).prop({
disabled: true
});
} else {
jQuery( "div.cred-taxonomy-category input[type=checkbox]" ).not( ":checked" ).prop({
disabled: false
});
};
};
countCheckedTopics();

jQuery( "div.cred-taxonomy-category input[type=checkbox]" ).on( "click", countCheckedTopics );

var countCheckedTopics = function() {
var nTopics = jQuery( "div.cred-taxonomy-company-state input:checked" ).length;
if( nTopics >= 2 ){
jQuery( "div.cred-taxonomy-company-state input[type=checkbox]" ).not( ":checked" ).prop({
disabled: true
});
} else {
jQuery( "div.cred-taxonomy-company-state input[type=checkbox]" ).not( ":checked" ).prop({
disabled: false
});
};
};
countCheckedTopics();

jQuery( "div.cred-taxonomy-company-state input[type=checkbox]" ).on( "click", countCheckedTopics );
});

Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.