# Online polls as a single HTML file
Build a **poll that lives on the host’s website**. The page should feel like their site, not a third-party widget. Optional save uses the portal form endpoint only.
Replace `FORM_ENDPOINT` with `https://myformconnect.io/f/YOUR_FORM_UUID` or `https://myformcapture.com/f/YOUR_FORM_UUID`.
## Rules
- One self-contained `index.html` (HTML + CSS + vanilla JS). No frameworks. No required CDNs.
- One question (or a short sequence of 1–5 questions). Multiple choice. Large tappable options on mobile.
- **Preview / test mode:** include a clearly labeled Test vote that does not POST and does not count as the one-time vote. Hosts must be able to click through before publishing.
- **Anonymous:** do not require name or email unless the prompt says otherwise. Do not collect extra identifiers.
- **One vote:** if the prompt asks for one vote per device, store a flag in `localStorage` keyed by a poll id. After a real vote, disable options and show results. Test votes must not set that flag.
- Submit **once** when the real vote is confirmed. Do not POST per click in preview.
- No third-party analytics, pixels, or trackers.
## Results
- After a real vote, show live-looking counts for this session (you may increment local counts). If POST succeeded, say the vote was saved. If the UUID is still `YOUR_FORM_UUID`, skip the network request and still show local results.
- **Download poll (HTML)** — Blob + ``.
## Optional save
If `YOUR_FORM_UUID` is still the placeholder, skip POST.
Otherwise POST `FormData` (do not set `Content-Type`) with `poll_id`, `choice`, and optional `answers` JSON.
## Branding
If the prompt says **no branding**, do not add Powered by, logos, or vendor names.
If the prompt asks for **optional credit**, a small footer: **Powered by MyFormConnect** (or MyFormCapture) linking to the portal home with `?ref=online-poll`.
## Related
- [Typeform-style questionnaires](./typeform-questionnaire.md)
- [HTML forms skill](../../myformconnect/html/SKILL.md)