Tell us what you are trying to do?
I need to disable single checkbox on form with multiple checkboxes field. Specifically the first checkbox (labelled Day 1) on this form. hidden link
I have looked at doing this via jquery, but the ID for each field is auto-generated and not consistent.
Hi,
Thank you for contacting us and I'd be happy to assist.
To disable the first checkbox of that field, you can structure your jQuery code like this:
jQuery(document).ready(function( $ ) {
$('ul.wpt-form-set-checkboxes-wpcf-attendance-days > li:first input').attr("disabled", true);
});
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar
Hmmm. That didn't work.
I added the code like this in the JS field on the Toolset form:
(function( $ ) {
"use strict";
jQuery(document).ready(function( $ ) {
$('ul.wpt-form-set-checkboxes-wpcf-attendance-days > li:first input').attr("disabled", true);
});
});
I apologize for the delay in getting back on this, as we had an unusually busy forum queue over the weekend.
Can you please test it without wrapping it within another function, like the way I shared? It should work that way.
Prefect. Thank you so much. Sorry. I wrapped it in a function as a habit.