# bit-form/3.1.1/assets/setFieldValues.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/setFieldValues.min.js
- Raw: https://pluginprobe.com/plugins/bit-form/3.1.1/raw/assets/setFieldValues.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/setFieldValues.min.js#L10-L20`.

```javascript
var setFieldValues=function(){"use strict";return function(e){try{(e?[e]:Object.keys(window?.bf_globals||{})).forEach((e=>{const t=window.bf_globals[e],n=t?.oldValues||{},{fields:c}=t,i=["select","phone-number","country","currency","file-up","advanced-file-up","repeater"],o=["radio","check","decision-box","image-select","gdpr"],l=bfSelect(`#form-${e}`);Object.entries(c).forEach((([c,s])=>{const a=s.typ;let r=s.fieldName;const u=n[c];if(u)if(i.includes(a))t.inits[c].value=u;else if(o.includes(a)){"check"===a&&(r+="[]");const e=l.querySelectorAll(`input[name="${r}"]`),n=u?.split(t?.configs?.bf_separator)||[];if(e.forEach((e=>{if(n.includes(e.value)){e.checked=!0;const t=n.indexOf(e.value);n.splice(t,1)}})),e[0]?.dispatchEvent(new Event("input")),n.length){const e=l.querySelector(`[data-oopt="${c}"]`);if(e){e.checked=!0;const t=l.querySelector(`.${c}-cw input[data-bf-other-inp]`);t&&(t.value=n.join(", "),e.value=n.join(", "),e.dispatchEvent(new Event("input")))}}}else if(u){const t=document.querySelector(`#form-${e} [name="${r}"]`);t&&(t.value=u),t.dispatchEvent(new Event("input"))}}))}))}catch(e){}}}();

```
