# ablocks/2.8.1/assets/build/blocks/paypal-button/view.js

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.8.1. 1 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.8.1/code/assets/build/blocks/paypal-button/view.js
- Raw: https://pluginprobe.com/plugins/ablocks/2.8.1/raw/assets/build/blocks/paypal-button/view.js
- Modified: 2025-09-03T12:45:06+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/ablocks/2.8.1/code/assets/build/blocks/paypal-button/view.js#L10-L20`.

```javascript
document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".ablocks-paypal-button__form").forEach(e=>{const t=e.getAttribute("data-ablocks__error-msg");e.addEventListener("submit",l=>{(function(e){const t=e.querySelector('input[name="business"]').value,l=e.querySelector('input[name="cmd"]').value,n=e.querySelector('input[name="item_name"]').value;return!!(t&&l&&n)})(e)||(l.preventDefault(),function(e,t){let l=e.querySelector(".ablocks-paypal-button__error");l||(l=document.createElement("p"),l.className="ablocks-paypal-button__error",l.style.color="red",l.style.fontSize="14px",l.style.textAlign="center",e.appendChild(l)),l.textContent=t||"Please fill in all required fields.",l.style.display="block"}(e,t))})})});
```
