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

```javascript
var replaceFieldAndSmartValues=function(){"use strict";return function(e,t){const c=new FormData(bfSelect(`#form-${t}`)),a=window?.bf_globals?.[t],{smartTags:n}=a;let r=e;const l=r.match(/\${b\d+-\d+}/g);l&&l.forEach((e=>{const t=e.replace(/\${|}/g,""),n=a.fields[t];if(!n)return;const{fieldName:l}=n,o=c.get(l);null!==o&&(r=r.replace(e,o))}));const o=r.match(/\${input.[a-zA-Z0-9-]+}/g);o&&o.forEach((e=>{const t=e.replace(/\${input.|}/g,""),a=c.get(t);null!==a&&(r=r.replace(e,a))}));const s=r.match(/\$\{([^}]+)\}/g);return s&&s.forEach((e=>{const t=e.replace(/\${|}/g,""),c=n[t];void 0!==c&&(r=r.replace(e,c))})),r}}();

```
