# bit-form/3.1.1/assets/initCheckDisableOnMax.min.js

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 3.1.1. 2 lines.

- Page: https://pluginprobe.com/plugins/bit-form/3.1.1/code/assets/initCheckDisableOnMax.min.js
- Raw: https://pluginprobe.com/plugins/bit-form/3.1.1/raw/assets/initCheckDisableOnMax.min.js
- Modified: 2026-04-21T11:19:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/3.1.1/code/assets/initCheckDisableOnMax.min.js#L10-L20`.

```javascript
var initCheckDisableOnMax=function(){"use strict";return function(e=null,t=""){(e?[e]:Object.keys(bf_globals)).forEach((e=>{const c=bfSelect(`#form-${e}`),{fields:l}=bf_globals[e];Object.keys(l).filter((e=>["check","image-select"].includes(l[e].typ))).forEach((r=>{if("undefined"!=typeof checkRepeatedField&&checkRepeatedField(r,bf_globals[e])&&!t)return;if(!l[r]?.valid?.disableOnMax)return;const i=`${t}.${r}-inp-wrp input[type='checkbox']`;c.querySelectorAll(i).forEach((e=>{e.addEventListener("change",(()=>{const e=Number(l[r].mx);if(c.querySelectorAll(`${i}:checked`).length>=e)c.querySelectorAll(i).forEach((e=>{e.checked||e.setAttribute("disabled",!0)}));else{const e=l[r].opt;c.querySelectorAll(i).forEach(((t,c)=>{e[c]?.disabled||t.removeAttribute("disabled")}))}}))}))}))}))}}();

```
