AI fill for static HTML sites: one script tag after your form

Updated 2026-10-30

Your visitors are tired of typing into boxes. Let their AI do it. On a plain HTML site you open the file, paste one script tag after your form, and upload the file. That is all. It also works in the template of a static site generator.

The whole page

Here is a full page you can copy and test. The script is the line after the form.

html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Join the book club</title>
  </head>
  <body>
    <main>
      <h1>Join the book club</h1>

      <form id="join" action="/thanks" method="post">
        <label for="fullname">Full name</label>
        <input id="fullname" name="fullname" required>

        <label for="email">Email</label>
        <input id="email" name="email" type="email" required>

        <label for="genre">Favourite kind of book</label>
        <select id="genre" name="genre">
          <option value="">Choose...</option>
          <option value="novel">Novel</option>
          <option value="history">History</option>
        </select>

        <button type="submit">Join</button>
      </form>

      <script src="https://aiformapi.com/agent-fill.js" data-form="#join"></script>
    </main>
  </body>
</html>

Steps

  1. Open the HTML file that holds your form.
  2. Find the closing form tag. Give the form an id if it has none.
  3. Paste the script line right after the closing form tag. Change #join to your form's id.
  4. Save the file and upload it, the way you always do.
  5. Open the page. A button appears above the form.

If the page has only one form, you can leave out data-form.

Make it better with small changes

  • Use real labels. Each label with a matching for gives your visitor's AI a clear question.
  • Mark required fields with required. The prompt then says which questions are required.
  • Set data-title. It names the form in the prompt, such as data-title="Join the book club".

Check it

Open the page, press the button, and read the prompt. It must show your labels. The select box shows its options in quotes. Fill in a test answer block by hand and paste it to see the boxes fill.

What I checked

I ran this exact page, with the address of my test server in place of aiformapi.com, in a browser. The button appeared above the form. The prompt listed the three questions. A pasted answer filled the boxes, including the select box, and the page sent nothing until I pressed the form's own button.

Sources (read 2026-10-30)

Questions

Does it matter where the form sends its data?

No. The script only reads the boxes and fills them. Your form can send its data to your own server or to any form service. Your visitor presses your own Submit button, and the form works as it does today.

Can I put the script in a shared layout or partial?

Yes. Put it after the form in the template that holds the form. If the layout is used on pages without that form, the script does nothing there. If a page has two forms, set data-form.

Do I need to host the script myself?

No. Load it from https://aiformapi.com/agent-fill.js. If your site uses a strict Content-Security-Policy, allow that address for scripts and allow inline styles for the dialog.