A static site to link people to when their web form submits upon the user confirming their IME input.
View the Project on GitHub kai-rin/your-form-submits-mid-japanese-input
If someone gave you a link to this page, they probably think your web form unintentionally submits when users hit the Enter key to confirm their IME input. This is most commonly reported by Japanese users, but affects anyone using an Input Method Editor (IME) – including Chinese (Pinyin) and Korean (Hangul) input.
This page will give you a brief description of what this problem is, why it happens, why it’s a big deal, and how to fix it.
Japanese text input uses an IME. Instead of each key producing a final character, the user types a pronunciation and then converts it to the correct characters. Here’s what typing “明日” (asu, meaning “tomorrow”) looks like:
a-s-u – the IME converts this to hiragana in real time: あす (shown underlined, meaning composition is still in progress)That Enter at step 3 is not a “submit” – it means “yes, this is the text I want.” But if your form submits on Enter, it fires here and the user never gets to finish typing their message.
The same process applies to Chinese (Pinyin) and Korean (Hangul) input methods – any language where an IME converts keystrokes into final characters through a confirmation step.
Imagine a user trying to type “明日の会議は10時からです” (Tomorrow’s meeting starts at 10). Here’s what actually happens on a broken form:
Types
a-s-u→ presses Space to convert to 明日 → presses Enter to confirm → form submits immediately.
The user never gets past the first word. This is especially painful in:
To put it another way – no one wants web forms constantly interrupting the input process like this:
This is what it feels like to type that sentence.
isComposingThe browser already knows when an IME conversion is in progress. You just need to check:
element.addEventListener("keydown", (event) => {
if (event.isComposing || event.keyCode === 229) {
return;
}
// Handle Enter key for form submission here
});
event.isComposing is true whenever the user is in the middle of IME input. The keyCode === 229 check is a fallback for Safari, which fires compositionend before keydown – causing isComposing to already be false when the keydown event fires. This dual check is recommended by MDN and works in all modern browsers (Chrome 56+, Firefox 31+, Safari 10.1+, Edge 79+).
Some forms avoid this problem entirely through design:
The key point: never let a bare Enter keypress trigger form submission without checking whether the user is composing text.
This problem affects any language that uses an IME – not just Japanese. Chinese (Pinyin, Zhuyin), Korean (Hangul), and others all go through a composition step that uses the Enter key. The isComposing fix shown above works for all of them.
This site was created from the author’s firsthand experience with Japanese input, but the underlying issue and the fix are universal. If you encounter this problem with any IME-based input, the same solution applies.
isComposing code example and Safari fallback explanation. Expanded scope to cover Chinese and Korean IME. Replaced dead W3C link with MDN references. Added concrete examples for chat interfaces and AI generation tools.Kairin - X