
Show HN: I pasted 16 form generators' output into a blank page – none send
This page writes a plain HTML form you can paste into any page. No Tailwind, no Bootstrap, and the short script at the end is optional. The sample has a name, email, phone, a subject list and a message.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
This page writes a plain HTML form you can paste into any page. No Tailwind, no Bootstrap, and the short script at the end is optional. The sample has a name, email, phone, a subject list and a message.
Short answer: An HTML form generator gives you markup you can paste into any page. This one writes a plain form element with labels, required fields, a small style block and a honeypot. No Tailwind or Bootstrap classes. The action already points to Formgong, so once you add your key the form sends without any JavaScript.
Pick a starting form or edit the sample. The preview and the HTML tab change as you type. Paste your access key and the preview's button sends a real test, so you can see the form work before it goes on your site.
New: open this form in the form builder to give it your site's colours and font and get the code for WordPress, Shopify, Wix or Webflow.
Only your description goes to the AI model. The answer replaces the fields above it, and you can edit them like any other.
Files need Uploads turned on for your form, plus the CAPTCHA widget from its Connect page. PDF, JPEG or PNG, up to 5 MB each.
Files need Uploads turned on for your form, plus the CAPTCHA widget from its Connect page. PDF, JPEG or PNG, up to 5 MB each.
Files need Uploads turned on for your form, plus the CAPTCHA widget from its Connect page. PDF, JPEG or PNG, up to 5 MB each.
Files need Uploads turned on for your form, plus the CAPTCHA widget from its Connect page. PDF, JPEG or PNG, up to 5 MB each.
Files need Uploads turned on for your form, plus the CAPTCHA widget from its Connect page. PDF, JPEG or PNG, up to 5 MB each.
Files need Uploads turned on for your form, plus the CAPTCHA widget from its Connect page. PDF, JPEG or PNG, up to 5 MB each.
This is the HTML tab, rendered. Paste your access key in step 4 and the button sends a real test submission.
Every copy below uses it as you type. Until then the code has fk_your_access_key, which Formgong refuses.
We email you a sign-in code. Your first form and its key are ready once you enter it. Enter the code in this tab and the form's Connect page starts with these fields.
Plain HTML with a short style block. The script at the end is optional: it keeps visitors on the page and says sent only when Formgong answers success: true. Delete it and the browser posts the form on its own.
<style> #fg-form{position:relative;box-sizing:border-box;display:grid;gap:16px;width:100%;max-width:520px;padding:28px;border:1px solid #dbe2ea;border-radius:8px;background:#fff;color:#0f172a;font:16px/1.5 system-ui,sans-serif} #fg-form *{box-sizing:border-box} #fg-form h2{margin:0;font-size:24px;line-height:1.3} #fg-form .fg-field{display:grid;gap:6px;min-width:0;margin:0;padding:0;border:0} #fg-form label,#fg-form legend{font-weight:500} #fg-form legend{padding:0;margin-bottom:2px} #fg-form input,#fg-form select,#fg-form textarea{width:100%;min-height:44px;padding:10px 12px;border:1px solid #64748b;border-radius:8px;background:#fff;color:inherit;font:inherit} #fg-form textarea{min-height:120px;resize:vertical} #fg-form .fg-choice{display:flex;align-items:center;gap:10px;font-weight:400} #fg-form .fg-choice input{width:20px;min-height:20px;margin:0;flex-shrink:0} #fg-form [aria-invalid=true]{border-color:#b91c1c} #fg-form .fg-error{margin:0;color:#b91c1c;font-size:14px} #fg-form .fg-status{margin:0} #fg-form .fg-credit{margin:0;font-size:13px;text-align:center} #fg-form .fg-credit a{color:#64748b} #fg-form .fg-error:empty{display:none} #fg-form button{min-height:48px;padding:12px 20px;border:0;border-radius:8px;background:#4338ca;color:#fff;font:inherit;font-weight:600;cursor:pointer} #fg-form button:disabled{opacity:.7;cursor:wait} #fg-form :focus-visible{outline:3px solid #4338ca;outline-offset:3px} #fg-form .fg-trap{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden} #fg-form select{appearance:none;-webkit-appearance:none;padding-inline-end:40px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 20px) 50%,calc(100% - 15px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}#fg-form select:dir(rtl){background-position:15px 50%,20px 50%}@media (forced-colors:active){#fg-form select{appearance:auto;-webkit-appearance:auto;background-image:none}} </style> <form id="fg-form" action="https://formgong.com/submit" method="POST"> <h2>Get in touch</h2> <input type="hidden" name="access_key" value="fk_your_access_key"> <input type="hidden" name="_lang" value="en"> <div class="fg-field"> <label for="fg-name">Name <span aria-hidden="true">*</span></label> <input type="text" id="fg-name" name="name" autocomplete="name" required aria-describedby="fg-name-error"> <p class="fg-error" id="fg-name-error"></p> </div> <div class="fg-field"> <label for="fg-email">Email <span aria-hidden="true">*</span></label> <input type="email" id="fg-email" name="email" autocomplete="email" required aria-describedby="fg-email-error"> <p class="fg-error" id="fg-email-error"></p> </div> <div class="fg-field"> <label for="fg-phone">Phone</label> <input type="tel" id="fg-phone" name="phone" autocomplete="tel" aria-describedby="fg-phone-error"> <p class="fg-error" id="fg-phone-error"></p> </div> <div class="fg-field"> <label for="fg-subject">Subject <span aria-hidden="true">*</span></label> <select id="fg-subject" name="subject" required aria-describedby="fg-subject-error"><option value="">Choose…</option><option value="A question">A question</option><option value="A quote">A quote</option><option value="Support">Support</option></select> <p class="fg-error" id="fg-subject-error"></p> </div> <div class="fg-field"> <label for="fg-message">Message <span aria-hidden="true">*</span></label> <textarea id="fg-message" name="message" required aria-describedby="fg-message-error" rows="4"></textarea> <p class="fg-error" id="fg-message-error"></p> </div> <div class="fg-trap" aria-hidden="true"><label>Leave this empty <input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label></div> <button type="submit">Send</button> <p class="fg-status" data-fg-status role="status"></p> <p class="fg-credit"><a href="https://formgong.com/en/?ref=badge&utm_source=badge&utm_medium=form&utm_campaign=generator" target="_blank" rel="noopener">Form by Formgong</a></p> </form> <script> // Optional. Without it the browser posts the form and Formgong shows its own thank-you or error page. (function () { var form = document.getElementById("fg-form"); var status = form.querySelector("[data-fg-status]"); form.noValidate = true; form.addEventListener("submit", function (event) { event.preventDefault(); var first = null, seen = {}; Array.prototype.forEach.call(form.elements, function (field) { var id = field.getAttribute("aria-describedby"); if (!id || seen[id]) return; seen[id] = true; var ok = field.checkValidity(); field.setAttribute("aria-invalid", ok ? "false" : "true"); document.getElementById(id).textContent = ok ? "" : field.validationMessage; if (!ok && !first) first = field; }); if (first) { first.focus(); return; } var button = form.querySelector("[type=submit]"); button.disabled = true; status.textContent = "Sending…"; fetch(form.action, { method: "POST", headers: { Accept: "application/json" }, body: new FormData(form) }) .then(function (response) { return response.json().catch(function () { return {}; }); }) .then(function (data) { if (data.success === true) { form.reset(); status.textContent = "Thank you. Your message was sent."; } else status.textContent = data.message || "Could not send. Please try again."; }) .catch(function () { status.textContent = "Could not reach the server. Check your connection and try again."; }) .then(function () { button.disabled = false; }); }); })(); </script> <!-- Optional: fg.js counts views, starts and the field people stop at for your Formgong Analytics page. No cookies. Delete this line to turn it off. --> <script src="https://formgong.com/fg.js" defer></script>The same form with Tailwind classes. Your site has to load Tailwind; this page does not.
<form class="relative mx-auto grid w-full max-w-lg gap-4 rounded-lg border border-slate-200 bg-white p-6 text-base text-slate-900" id="tw-form" action="https://formgong.com/submit" method="POST"> <h2 class="text-2xl font-semibold">Get in touch</h2> <input type="hidden" name="access_key" value="fk_your_access_key"> <input type="hidden" name="_lang" value="en"> <div class="grid gap-1.5"> <label class="font-medium" for="tw-name">Name <span aria-hidden="true">*</span></label> <input class="w-full rounded-md border border-slate-400 bg-white px-3 py-2 text-base text-slate-900 aria-[invalid=true]:border-red-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700" type="text" id="tw-name" name="name" autocomplete="name" required aria-describedby="tw-name-error"> <p class="text-sm text-red-700 empty:hidden" id="tw-name-error"></p> </div> <div class="grid gap-1.5"> <label class="font-medium" for="tw-email">Email <span aria-hidden="true">*</span></label> <input class="w-full rounded-md border border-slate-400 bg-white px-3 py-2 text-base text-slate-900 aria-[invalid=true]:border-red-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700" type="email" id="tw-email" name="email" autocomplete="email" required aria-describedby="tw-email-error"> <p class="text-sm text-red-700 empty:hidden" id="tw-email-error"></p> </div> <div class="grid gap-1.5"> <label class="font-medium" for="tw-phone">Phone</label> <input class="w-full rounded-md border border-slate-400 bg-white px-3 py-2 text-base text-slate-900 aria-[invalid=true]:border-red-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700" type="tel" id="tw-phone" name="phone" autocomplete="tel" aria-describedby="tw-phone-error"> <p class="text-sm text-red-700 empty:hidden" id="tw-phone-error"></p> </div> <div class="grid gap-1.5"> <label class="font-medium" for="tw-subject">Subject <span aria-hidden="true">*</span></label> <select class="w-full rounded-md border border-slate-400 bg-white px-3 py-2 text-base text-slate-900 aria-[invalid=true]:border-red-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700" id="tw-subject" name="subject" required aria-describedby="tw-subject-error"><option value="">Choose…</option><option value="A question">A question</option><option value="A quote">A quote</option><option value="Support">Support</option></select> <p class="text-sm text-red-700 empty:hidden" id="tw-subject-error"></p> </div> <div class="grid gap-1.5"> <label class="font-medium" for="tw-message">Message <span aria-hidden="true">*</span></label> <textarea class="w-full rounded-md border border-slate-400 bg-white px-3 py-2 text-base text-slate-900 aria-[invalid=true]:border-red-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700 min-h-28" id="tw-message" name="message" required aria-describedby="tw-message-error" rows="4"></textarea> <p class="text-sm text-red-700 empty:hidden" id="tw-message-error"></p> </div> <div class="absolute -left-[9999px] h-px w-px overflow-hidden" aria-hidden="true"><label>Leave this empty <input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label></div> <button class="min-h-12 rounded-md bg-indigo-700 px-4 py-3 font-semibold text-white disabled:opacity-70" type="submit">Send</button> <p class="empty:hidden" data-fg-status role="status"></p> <p class="text-center text-sm text-slate-500"><a href="https://formgong.com/en/?ref=badge&utm_source=badge&utm_medium=form&utm_campaign=generator" target="_blank正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。