# bit-form/2.10.0/assets/isFormValidatedWithoutError.min.js

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

- Page: https://pluginprobe.com/plugins/bit-form/2.10.0/code/assets/isFormValidatedWithoutError.min.js
- Raw: https://pluginprobe.com/plugins/bit-form/2.10.0/raw/assets/isFormValidatedWithoutError.min.js
- Modified: 2023-09-12T07:43:02+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/2.10.0/code/assets/isFormValidatedWithoutError.min.js#L10-L20`.

```javascript
var isFormValidatedWithoutError=function(){"use strict";return async function(e,{step:t}={}){if("undefined"!=typeof validateForm&&!validateForm({form:e},{step:t}))return new Promise(((e,t)=>{t(new Error("Form is not valid"))}));const a=document.getElementById(e);a.classList.add("pos-rel","form-loading");let n=new FormData(document.getElementById(`form-${e}`));const o=window.bf_globals[e],{grecaptcha:r}=window;if("v3"===o?.gRecaptchaVersion&&o?.gRecaptchaSiteKey){const e=await r.execute(o?.gRecaptchaSiteKey,{action:"submit"});n.append("g-recaptcha-response",e)}"undefined"!=typeof advancedFileHandle&&(n=advancedFileHandle(o,n)),o.GCLID&&n.set("GCLID",o.GCLID),t&&n.set("form-current-step",t);const i=[];Object.entries(o?.fields||{}).forEach((e=>{e[1]?.valid?.hide&&i.push(e[0])})),i.length&&n.append("hidden_fields",i);const s=new URL(o.ajaxURL);s.searchParams.append("action","bitforms_before_submit_validate");const d=await fetch(s,{method:"POST",body:n}),c=await d.json();return a.classList.remove("pos-rel","form-loading"),c.success?new Promise((e=>{e(!0)})):(bfValidationErrMsg(c,e),new Promise(((e,t)=>{t(new Error("Form is not valid"))})))}}();

```
