Share a calculator as a link
Pricing, ROI and loan calculators from Claude or ChatGPT are one HTML file. Three bugs to check before you send it, why a pre-filled ?amount= link comes through empty, and how to collect the quotes people calculate.
Ask Claude or ChatGPT for a pricing calculator, an ROI estimate or a loan payment tool and you get one HTML file with a few inputs and a script. It runs in any browser with no server, so it can go out as a link.
Check three things before you send it. Each was tested in Chrome.
2 + 3 = 23
The value of an input is always a string, even for <input type="number">. Adding two of them joins the text: an input holding 2 plus an input holding 3 gave "23". Multiplying happens to work, because * converts strings to numbers, so a calculator can pass a quick test and still be wrong wherever it adds.
Read numbers with input.valueAsNumber or Number(input.value) before doing any arithmetic. Or ask the AI tool: "Convert every input value to a number before using it."
An empty field counts as zero
Number("") is 0, so a cleared field silently becomes zero and the total still shows. valueAsNumber on an empty number input is NaN instead, which you can check for. Show a prompt such as "Enter a price" rather than a total when any required field is empty.
Update the result on the input event, not change. change fires only when the field loses focus or the viewer presses Enter, so the total lags behind what they typed.
0.1 + 0.2 = 0.30000000000000004
JavaScript numbers are binary floating point, and 0.1 + 0.2 printed 0.30000000000000004. Money totals show long tails like this as soon as cents are involved.
Round only for display: total.toFixed(2), or Intl.NumberFormat with style "currency", which adds the symbol and separators. Pass the locale and currency, for example new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }); with no locale, it uses the runtime's default locale (MDN, Intl.NumberFormat).
Pre-filled links come through empty
Calculators often read starting values from the address, such as ?amount=500 or #plan=team. On FileShare Pro the share link opens the document view, which loads your file in a frame from the content host. The frame's address is built from the file alone, so a query string or hash added to the share link never reaches the page, and location.search inside it is empty.
Put the starting values in the file instead, as value attributes on the inputs. For two or three presets, such as one per client, upload a copy for each with its own values. Each copy gets its own link and its own comments.
Collect what people calculate
To turn the calculator into a quote request, wrap the inputs in a form with data-fsp-form: <form data-fsp-form="quote">. On the share link, each submit is stored as a row on your file, and you read the rows in the document view and download them as CSV. Viewers cannot read each other's rows.
Put the computed total in a hidden input named total and set it every time the result updates, not in the submit handler. Tested with the quiz version of this: a value set in the page's own submit handler was sent empty. Details: sharing a quiz and collecting the scores.
Each response holds up to 10 fields of up to 500 characters each. A file collects up to 1,000 responses on Free and 10,000 on Pro and Team.
Upload it and send the link
Drag the HTML file onto the FileShare Pro dashboard and copy the link. Viewers need no account, and they can leave comments on the page, such as a question about a line item.
A "Copy result" button that uses navigator.clipboard.writeText works in the document view; the frame allows clipboard writes.
To change a rate or fix a formula after sending, upload the new file over the old one and the link stays the same: updating a shared link without changing it.
Related: sharing a tracker or to-do app, sharing the app your AI built and why a page that works in chat breaks when hosted.
Frequently asked
Yes. The script is part of the page, so anyone can open the source and read it. Keep anything private, such as your margin or a cost table, out of the file.
Anyone with the link can open it. Password-protected links are on Pro: password-protecting an HTML page.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free