Calculator AI allows you to add custom JavaScript to your calculator for advanced use cases that go beyond built-in configuration. You can run code when the calculator first loads (global scripts) or when a specific option's value changes (option scripts). This is useful for integrating with third-party tools, implementing custom validation, or adding dynamic behavior. You configure scripts in Calculator Editor → Placement & Styling → JavaScript sub-tab.
Test custom scripts thoroughly before publishing — errors can break the calculator experience for customers.
| Script Type | Trigger | Use Case |
|---|---|---|
| Global script | Calculator loads on the page | Initialize libraries, set up listeners, run one-time logic |
| Option script | Attached option's value changes | React to user input, call APIs, update UI dynamically |