ទម្រង់

ទម្រង់ដែលដំណើរការដោយមិនចាំបាច់មាន backend

បន្ថែម attribute តែមួយទៅទម្រង់នៅលើគេហទំព័រ static របស់អ្នក នោះការបញ្ជូនទាំងអស់នឹងចូលមក dashboard របស់អ្នក។ មិនចាំបាច់ JavaScript មិនចាំបាច់ widget បង្កប់ មិនចាំបាច់សេវាកម្មភាគីទីបី ហើយអ្នកដែលបំពេញវាក៏មិនចាំបាច់ចុះឈ្មោះអ្វីដែរ។

Its markup, styles and deploy script are on GitHub — copy it, change the fields, redeploy.

index.html
<form harvis-form="contact">
  <input name="email" type="email" required>
  <textarea name="message"></textarea>
  <button>Send</button>
</form>
how it works

បីជំហាន ហើយមួយក្នុងចំណោមនោះគឺគ្រាន់តែដេប្លយម្តងទៀត

គ្មានកម្មវិធីបង្កើតទម្រង់ណាត្រូវរៀន ហើយក៏គ្មាន endpoint ណាត្រូវចម្លងដែរ។ Attribute នេះហើយជាការរៀបចំទាំងមូល។

  1. 01

    បន្ថែម attribute

    ដាក់ harvis-form លើទម្រង់ណាមួយក្នុង HTML របស់អ្នក។ ដាក់ឈ្មោះឱ្យវា បើគេហទំព័រមានទម្រង់លើសពីមួយ។ មិនបាច់ដាក់ action និង method ទេ — ពួកវានឹងត្រូវបំពេញនៅពេលទំព័រត្រូវបានបញ្ជូនចេញ។

  2. 02

    ដេប្លយម្តងទៀត

    អូសថតឯកសារចូលម្តងទៀត ឬដំណើរការ npx harvis។ គ្មានអ្វីត្រូវកំណត់ គ្មានកូនសោត្រូវបិទភ្ជាប់ គ្មានប៊ូតុងណាត្រូវបើកនៅក្នុង dashboard ជាមុនឡើយ។

  3. 03

    អានអ្វីដែលចូលមក

    ការបញ្ជូននឹងបង្ហាញនៅក្រោមគេហទំព័ររបស់អ្នកក្នុង dashboard ដោយថ្មីជាងគេនៅមុនគេ។ បើកជួរណាមួយដើម្បីអានទាំងស្រុង ឬយកទាំងអស់ជា CSV។

the markup

ទាំងអស់នេះគឺ attribute ពីរប៉ុណ្ណោះ

harvis សរសេរទម្រង់ឡើងវិញនៅពេលវាចេញពី server ដូច្នេះទំព័រដែលអ្នកសរសេរនៅតែជាទំព័រដែលអ្នកសរសេរ។

អ្វីដែលអ្នកសរសេរ
<form harvis-form="contact"
      data-harvis-redirect="/thanks.html">
  <input name="email" type="email" required>
  <button>Send</button>
</form>
អ្វីដែលអ្នកចូលមើលទទួលបាន
<form harvis-form="contact"
      data-harvis-redirect="/thanks.html"
      action="/__harvis/form/contact" method="post">
  <input type="hidden" name="_harvis_redirect" value="/thanks.html">
  <input type="text" name="_harvis_hp" tabindex="-1" aria-hidden="true" style="…">
  <input name="email" type="email" required>
  <button>Send</button>
</form>

Attribute ទាំងពីរ

harvis-form
សម្គាល់ទម្រង់នេះថាជាទម្រង់ដែលត្រូវប្រមូល។ តម្លៃរបស់វាគឺជាឈ្មោះ ដូច្នេះទម្រង់ច្រើននៅលើគេហទំព័រតែមួយនៅតែដាច់ដោយឡែក។ បើមិនដាក់តម្លៃ វានឹងត្រូវប្រមូលក្រោមឈ្មោះ “default”។
data-harvis-redirect
ជាជម្រើស។ ទំព័រនៅលើគេហទំព័ររបស់អ្នកដែលត្រូវនាំមនុស្សទៅបន្ទាប់ពីពួកគេផ្ញើ។ អ្វីក៏ដោយដែលចង្អុលទៅក្រៅគេហទំព័ររបស់អ្នកនឹងត្រូវមិនអើពើ។
frameworks

ពេល JavaScript ជាអ្នកសាងទម្រង់ សូមសរសេរ endpoint ដោយខ្លួនឯង

harvis បំពេញ action នៅពេលទំព័រចាកចេញពីម៉ាស៊ីនមេ។ ទម្រង់ដែលកើតមានតែក្រោយពេល bundle របស់អ្នកដំណើរការ គឺមិនទាន់មាននៅក្នុងទំព័រនៅឡើយទេ ដូច្នេះគ្មានអ្វីត្រូវបំពេញ — អ្នកសរសេរនូវអ្វីដែលការសរសេរជំនួសនោះនឹងបានសរសេរ។ វានៅតែជា post HTML ធម្មតា ហើយអ្វីៗផ្សេងទៀតនៅទំព័រនេះនៅតែអនុវត្តបានដដែល។

  • React
  • Vue
  • Svelte
  • Angular
ContactForm.jsx
<form action="/__harvis/form/contact" method="post">
  <input name="email" type="email" required />
  <textarea name="message" />

  {/* optional — where to land after sending */}
  <input type="hidden" name="_harvis_redirect" value="/thanks" />

  {/* optional — the decoy harvis would have added */}
  <input
    type="text"
    name="_harvis_hp"
    tabIndex={-1}
    autoComplete="off"
    aria-hidden="true"
    style={{ position: "absolute", left: "-9999px", opacity: 0 }}
  />

  <button>Send</button>
</form>
action + method
គឺ endpoint ដែល harvis នឹងបានសរសេរ បូកនឹង post។ ផ្នែកចុងក្រោយគឺឈ្មោះទម្រង់ — អក្សរតូច លេខ និងសញ្ញាដាច់ ចំណែកអ្វីផ្សេងទៀតត្រូវប្រមូលនៅក្រោម “default”។
_harvis_redirect
មិនចាំបាច់ ហើយជាទម្រង់សរសេរដោយដៃនៃ data-harvis-redirect។ ត្រូវជាផ្លូវនៅលើគេហទំព័ររបស់អ្នកផ្ទាល់ អ្វីដែលចង្អុលចេញក្រៅត្រូវបានមិនអើពើ។
_harvis_hp
មិនចាំបាច់ ហើយជារបស់តែមួយគត់ដែលអ្នកបាត់បង់ពេលសរសេរទម្រង់ដោយខ្លួនឯង៖ នុយដែលចាប់ bot។ សូមរុញវាចេញក្រៅអេក្រង់ ជាជាងប្រើ display:none ហើយទុកឱ្យទទេ — អ្វីដែលបំពេញវានឹងត្រូវបោះចោល។
harvis-form
កុំដាក់វា។ attribute នេះគឺជាការស្នើឱ្យ harvis សរសេរ action ជំនួស ហើយអ្នកទើបតែសរសេរវាដោយខ្លួនឯងរួចហើយ។

ទុកឱ្យកម្មវិធីរុករកជាអ្នកផ្ញើ

គ្មាន preventDefault គ្មាន fetch។ ចម្លើយគឺជាការបញ្ជូនបន្តដែលកម្មវិធីរុករកដើរតាមដោយខ្លួនឯង ហើយនោះហើយជាអ្វីដែលរក្សាទម្រង់ឱ្យដំណើរការ ពេល script មិនដំណើរការ។

Prerender ក៏រាប់ជា JavaScript ដែរ

បើ build របស់អ្នកសរសេរទម្រង់ចូលក្នុង HTML រួចកម្មវិធីរបស់អ្នកទទួលយកវានៅក្នុងកម្មវិធីរុករក សូមសរសេរវាលទាំងនោះដដែល — វាលដែល harvis បញ្ចូលមិនមាននៅក្នុង component របស់អ្នកទេ ដូច្នេះ hydration អាចបោះវាចោល។

ai agents

Hand it to the agent that wrote your site

If an AI built the site, it can wire the forms up too. Copy the brief below into whatever has your project open — Claude Code, Cursor, Copilot, the chat you built the page in — and it will find the forms you already have and convert them. It covers both cases on this page, so you don't have to know which one you're in.

paste this into your ai agent
Wire the forms in this project up to harvis.dev (https://harvis.dev), which collects form submissions for static sites that have no backend. Read all of this before editing anything.

HOW IT WORKS
harvis serves every page of a site it hosts, so it can take a form post on the way past. Marking a <form> with the harvis-form attribute is the whole integration: as the page is served, harvis rewrites that tag to action="/__harvis/form/<name>" method="post", inserts a hidden honeypot field, and turns data-harvis-redirect into a hidden field. The form then posts natively, same-origin, with no JavaScript, no API key and no third-party service. Submissions appear in the site owner's dashboard (https://harvis.dev/dashboard) and are emailed to them.

STEP 1 — FIND THE FORMS
Look for every <form> in the project: .html files, and templates or components if a framework is in use. Skip search boxes and any form that posts to an API this project owns and expects a reply from. For each remaining form, decide which case it is:
- CASE A — the form is in the HTML that gets deployed: plain HTML, or a generator/framework that renders it at build time. This is the common case.
- CASE B — the form only exists once JavaScript has run: a React/Vue/Svelte/Angular component mounted in the browser, or markup a script writes. harvis rewrites the served HTML, so a form that is not in it yet is never rewritten. A form that is prerendered and then hydrated is CASE B too, because the fields harvis inserts are not in the component tree and hydration can discard them.

STEP 2A — CASE A: ADD THE ATTRIBUTE
- Add harvis-form="<name>" to the opening <form> tag. Name it for what it is — contact, signup, feedback. The name must match ^[a-z0-9][a-z0-9_-]{0,39}$ or it is collected under "default". Two forms on one site should not share a name unless they should share one list of submissions.
- Delete that form's existing action and method attributes. harvis overwrites both, so leaving them there only misleads whoever reads the file next.
- Optional: add data-harvis-redirect="/thanks.html" to choose where the visitor lands after sending. It must be a path on this same site and the file must exist in the deploy; anything pointing off-site is ignored. Without it, visitors get a plain harvis confirmation page.
- Do not add a honeypot, _harvis_hp or _harvis_redirect by hand — harvis inserts them, and a second copy is a bug.

STEP 2B — CASE B: WRITE THE ENDPOINT YOURSELF
- Set action="/__harvis/form/<name>" and method="post" on the form, and do NOT add harvis-form: that attribute is a request to rewrite, and here you have written the rewrite yourself.
- Optional redirect: a hidden input named _harvis_redirect whose value is a path on this site.
- Optional honeypot, since nothing will add one for you: an empty text input named _harvis_hp with tabindex -1, autocomplete off, aria-hidden true, positioned off-screen with position:absolute;left:-9999px rather than display:none.
- Let the browser submit it: no onSubmit handler, no preventDefault, no fetch. The reply is a 303 that the browser follows on its own, and intercepting it is what breaks the form when scripts fail.

STEP 3 — IN BOTH CASES
- Every field to be collected needs a name attribute; an input without one is never submitted. Those names become the column headings the owner reads, so prefer name, email and message over field1.
- Remove what is left of any other form service: a Formspree, Getform, Basin or FormSubmit action URL, Netlify's data-netlify attribute and its hidden form-name input, a Web3Forms access_key input, and any handler that POSTed the form somewhere else.
- Keep the client-side validation as it is. required, type="email", minlength and the rest all still work.
- File inputs are dropped: submissions are stored as text and files are not kept. If a form has one, say so rather than leaving it in silently.
- Add no script, SDK, key or config file. There is nothing to install.
- Limits, worth mentioning if a form is likely to meet one: 30 fields per submission, 5,000 characters per field, 64 KB per submission, 60 submissions per site an hour, 20 per visitor an hour, and the newest 1,000 per site are kept.

STEP 4 — DEPLOY AND REPORT
- The attribute only does anything on a served page, so deploy the site again: run npx harvis from the site folder, or tell the user to drag the folder onto https://harvis.dev/drop.
- Then tell the user which files changed, the name you gave each form, and that submissions arrive at https://harvis.dev/dashboard and by email — noting that a site deployed anonymously has no owner to email until it is claimed with the claim link.
- Suggest they send one test submission through the live site.

What it tells the agent to do

  • Find every form in the project and leave the search boxes and API calls alone.
  • Add harvis-form with a sensible name, and strip the action and method that harvis replaces anyway.
  • Write the endpoint by hand instead when the form only exists after JavaScript runs.
  • Clear out whatever the last form service left behind, and flag a file upload as something that won't be kept.
  • Redeploy, then tell you what changed and where the submissions land.

Or leave it in the repo

The same text works as a file — save it as AGENTS.md, CLAUDE.md or a project rule and an agent reads it on its own, so the next form someone adds is collected without anyone asking.

included

អ្វីដែលអ្នកទទួលបាន

អ្វីៗខាងក្រោមនេះបើកជាស្រេចតាំងពីដំបូង។ គ្មានទំព័រការកំណត់សម្រាប់មួយណាឡើយ។

  • មិនចាំបាច់ JavaScript

    ទម្រង់បញ្ជូនតាមរបៀបដែល HTML បញ្ជូនតាំងពីដើមមក។ វានៅតែដំណើរការទោះបី script ត្រូវបានទប់ស្កាត់ លើទូរស័ព្ទយឺត និងក្នុងកម្មវិធីរុករកដែលបង្ហាញបានតែអក្សរ។

  • សារឥតបានការត្រូវបានច្រោះ

    គ្រប់ទម្រង់ត្រូវបានបញ្ជូនចេញជាមួយវាលបញ្ឆោតមួយដែលមនុស្សមើលមិនឃើញ ហើយអ្វីដែលបំពេញវានឹងត្រូវបោះចោលដោយស្ងៀមស្ងាត់។ ដែនកំណត់អត្រាកំណត់ថាអ្នកចូលមើលម្នាក់ និងគេហទំព័រមួយ អាចផ្ញើបានប៉ុន្មានក្នុងមួយម៉ោង។

  • ទម្រង់ប៉ុន្មានក៏បានតាមចិត្ត

    ដាក់ឈ្មោះឱ្យពួកវា — ទម្រង់ទំនាក់ទំនង និងទម្រង់ចុះឈ្មោះនៅលើគេហទំព័រតែមួយ មានបញ្ជីរៀងៗខ្លួន ហើយអ្នកអាចច្រោះ និងនាំចេញពួកវាដាច់ដោយឡែកបាន។

  • ទំព័រអរគុណផ្ទាល់ខ្លួនរបស់អ្នក

    ចង្អុលទម្រង់ទៅទំព័រដែលអ្នកសរសេរផ្ទាល់ នោះមនុស្សនឹងទៅដល់ទីនោះបន្ទាប់ពីផ្ញើ។ បើមិនដាក់ ពួកគេនឹងឃើញទំព័របញ្ជាក់ធម្មតាមួយជំនួសវិញ។

  • នាំចេញពេលណាក៏បាន

    ប៊ូតុងតែមួយផ្តល់ឱ្យអ្នកនូវ CSV ដែលមានជួរឈរសម្រាប់គ្រប់វាលដែលធ្លាប់មានអ្នកណាបញ្ជូនចូល ដូច្នេះទម្រង់ដែលបានបន្ថែមសំណួរនៅពាក់កណ្តាលផ្លូវ ក៏នៅតែបើកចេញជាតារាងតែមួយដដែល។

  • គ្មានអ្វីតាមដានអ្នកណាទេ

    គ្មាន script តាមដាន គ្មាន cookie គ្មានភាគីទីបីនៅក្នុងទំព័រ។ អាសយដ្ឋានរបស់អ្នកចូលមើលត្រូវបាន hash មុនពេលរក្សាទុក ហើយធ្វើដូច្នេះក៏គ្រាន់តែដើម្បីឱ្យដែនកំណត់អត្រាអាចបែងចែកការបញ្ជូនពីរបានប៉ុណ្ណោះ។

limits

ដែនកំណត់

ធូរធារសម្រាប់ទម្រង់ទំនាក់ទំនង ប៉ុន្តែតឹងល្មមមិនឱ្យ script ដែលតម្រង់មកគេហទំព័ររបស់អ្នកបំពេញប្រអប់សំបុត្ររបស់អ្នកបាន។

វាលក្នុងមួយការបញ្ជូន
៣០
ប្រវែងវាលមួយ
៥,០០០ តួអក្សរ
ទំហំការបញ្ជូនមួយ
៦៤ KB
ការបញ្ជូនក្នុងមួយគេហទំព័រ
៦០ ក្នុងមួយម៉ោង
ការបញ្ជូនក្នុងមួយអ្នកចូលមើល
២០ ក្នុងមួយម៉ោង
រក្សាទុកក្នុងមួយគេហទំព័រ
១,០០០ ថ្មីជាងគេនៅមុនគេ
faq

សំណួរ

អ្វីដែលមនុស្សសួរ មុនពេលដាក់ទម្រង់លើគេហទំព័រ static។

តើទម្រង់ static ជាអ្វី?

គឺទម្រង់នៅលើគេហទំព័រដែលគ្មាន server ផ្ទាល់ខ្លួន។ ជាធម្មតា នោះមានន័យថាទម្រង់គ្មានកន្លែងណាត្រូវផ្ញើទៅទេ ដែលជាមូលហេតុធ្វើឱ្យគេហទំព័រ static ភាគច្រើនត្រូវខ្ចីសេវាកម្មទម្រង់របស់ភាគីទីបី។ harvis បញ្ជូនគ្រប់ទំព័រនៃគេហទំព័ររបស់អ្នករួចជាស្រេចហើយ ដូច្នេះវាអាចទទួលការបញ្ជូននៅតាមផ្លូវបានតែម្តង។

តើខ្ញុំត្រូវចេះសរសេរកូដទេ?

អ្នកគ្រាន់តែត្រូវបន្ថែមពាក្យមួយទៅក្នុង HTML មួយបន្ទាត់ប៉ុណ្ណោះ។ បើ AI ជាអ្នកសរសេរគេហទំព័ររបស់អ្នក សូមប្រាប់វាឱ្យបន្ថែម attribute harvis-form ទៅទម្រង់ — វាដឹងវិធីរួចហើយ ព្រោះការណែនាំដែល harvis ចេញផ្សាយសម្រាប់ជំនួយការ AI បាននិយាយដូច្នេះ។

តើវាដំណើរការទេ បើបិទ JavaScript?

ដំណើរការ។ នោះហើយជាមូលហេតុដែលវាត្រូវបានសាងសង់បែបនេះ។ ទម្រង់ធ្វើការ post HTML ធម្មតា ហើយកម្មវិធីរុករកតាមការបញ្ជូនបន្តបន្ទាប់ពីនោះ ដូចគ្នាបេះបិទនឹងរបៀបដែលទម្រង់ដំណើរការមុនពេលមាន JavaScript។

តើខ្ញុំអាចបន្តប្រើ endpoint ផ្ទាល់ខ្លួន ឬសេវាកម្មទម្រង់ផ្សេងបានទេ?

បាន — គ្រាន់តែកុំបន្ថែម attribute នេះ។ ទម្រង់ដែលគ្មាន harvis-form ត្រូវបានបញ្ជូនចេញដូចអ្នកសរសេរបេះបិទ រួមទាំង action ផង។ ចំពោះទម្រង់ដែលមានវា harvis នឹងជំនួស action ព្រោះការបន្ថែម attribute នេះជារបៀបដែលអ្នកប្រាប់ថាការបញ្ជូនគួរទៅណា។

តើវាដំណើរការជាមួយ React, Vue ឬ Svelte ទេ?

ដំណើរការ ដោយមានជំហានបន្ថែមមួយ។ បើទម្រង់មាននៅក្នុង HTML ដែល build របស់អ្នកបង្កើត នោះ attribute មួយគ្រប់គ្រាន់ហើយ។ បើវាលេចឡើងតែក្រោយពេល JavaScript ដំណើរការ សូមសរសេរ action="/__harvis/form/contact" និង method="post" ចូលក្នុង component វិញ — endpoint ដដែល dashboard ដដែល ហើយកម្មវិធីរុករកនៅតែជាអ្នកផ្ញើដដែល។

តើមនុស្សអាចភ្ជាប់ឯកសារបានទេ?

មិនទាន់ទេ។ វាលឯកសារនៅលើទម្រង់ដែលត្រូវប្រមូល នៅតែដំណើរការសម្រាប់អ្នកចូលមើល ប៉ុន្តែឯកសារនោះមិនត្រូវបានរក្សាទុកទេ — មានតែវាលអក្សរប៉ុណ្ណោះដែលត្រូវរក្សាទុក។

តើការបញ្ជូននឹងទៅជាយ៉ាងណា បើខ្ញុំលុបគេហទំព័រ?

ពួកវានឹងបាត់ទៅជាមួយ។ ការបញ្ជូនជាកម្មសិទ្ធិរបស់គេហទំព័រ មិនមែនរបស់ការដេប្លយណាមួយទេ ដូច្នេះការដេប្លយម្តងទៀតរក្សាពួកវាទុក ចំណែកការលុបគេហទំព័រវិញលុបពួកវាចោលជារៀងរហូត។ សូមនាំចេញជា CSV ជាមុនសិន បើអ្នកចង់រក្សាទុកពួកវា។

ដាក់គេហទំព័រឱ្យដំណើរការ រួចសាកល្បងមើល

ការផ្សព្វផ្សាយគឺឥតគិតថ្លៃ ហើយចំណាយពេលប្រហែលពីរវិនាទី។ បន្ថែម attribute ទៅទម្រង់មួយ ដេប្លយម្តងទៀត រួចផ្ញើសារសាកល្បងទៅខ្លួនឯង។

ដាក់គេហទំព័រឱ្យដំណើរការ