Can a checkbox in Contact Form 7 (WordPress plugin) be disabled?
I have a group of 5 checkboxes, and I want one to be there, but disabled (not clickable, not selected).
How to do it?
Can a checkbox in Contact Form 7 (WordPress plugin) be disabled?
I have a group of 5 checkboxes, and I want one to be there, but disabled (not clickable, not selected).
How to do it?
You must be logged in to post a comment.
Add an id to your to your checkbox. It will look something like this, it is important that the id is after the variable as shown below.
This will put the id “disablethis” on the span tag that surrounds your checkbox (input) that you are trying to disable. Then we can simply find that span and disable all of the inputs within it like so. Put this at the bottom of your form/page.
you can disable it by using jQuery like this :
where #checkbox is the ID of checkbox.
Thanks a million ImTheMechanic! I was looking for a few days how to reference the checkbox and set its state (checked or unchecked).
I had to put :input after the id.
I could never have guessed!
I did it like this:
Thanks!