at_ease_jonathan
at_ease_jonathan

Reputation: 13

Disable autocomplete for Japanese

I am making a Japanese typing game for the browser using HTML, CSS and JavaScript. Everything is fine, except when I type hiragana cahrecters into the input field, it suggests different hiragana and kanji. This basically ruins the point of the typing game. The HTML autocomplete = "off" does not work... Any ideas?

Upvotes: 0

Views: 1823

Answers (2)

tinsep19
tinsep19

Reputation: 1

For Chrome, <input type="search"> might be the behavior you want.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search

type=search is similar to text, but may be implemented specifically for search fields.

Currently Chrome does not show IME suggestions when type=search is specified. It seems that consideration is given so that the search field suggestions and IME suggestions do not overlap.

I don't know that it can be implemented with other input elements

A related specification is inputmode="search". I tried <input type="text" inputmode="search">, <textarea inputmode="search">, but IME suggestions were displayed.

Upvotes: 0

dave
dave

Reputation: 64695

autocomplete="one-time-code"

A lot of browsers ignore off, autocomplete="new-password" works but then the browser might suggest a strong password, "one-time-code" is officially supported.

But really, you can just use any random string for the field and it should work, like

autocomplete="seriously-please-don't-autocomplete"

And if that doesn't work, this hack generally does:

<input readonly onfocus="this.removeAttribute('readonly');">

Upvotes: 0

Related Questions