Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Samsung predictive text in HTML form

I have an HTML form with a text input field. As the user types, we do AJAX requests to get predictive text suggestions, based on a list of values in our database.

We display that list and the user can select one of them; then we show them the rest of the form.

If you're viewing our web page on a Samsung Galaxy S4, in its built-in browser or Chrome or Firefox, the device's predictive input suggestions also appear as the user types. e.g. see the screenshot:

enter image description here

It's easy enough for an individual user to disable this in the settings on their own phone. However we want to make it so it's always disabled for this field for all users. We're already doing all the following, which don't seem to prevent it appearing:

<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"> 

You can also see this here.

Any suggestions?

like image 417
duncan Avatar asked Oct 06 '15 11:10

duncan


People also ask

How do I turn off autocorrect in HTML?

Use the <input> tag with autocomplete attribute. Set the autocomplete attribute to value “off”.

How do I turn off Predictive text on Android?

Go to the keyboard app's settings. Scroll down and look for “Text Correction” or something similar. Tap on “Predictive Text” or “Next-Word Suggestions” to toggle the feature off. Test the keyboard and see if the option is disabled.


1 Answers

I've tried different things and it seems that on mobile you currently have no chance to do this in a proper way.

According to Safari Developer Docs there is support https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html but it seems that this is more related to the Desktop Safari than iOS.

Additionally, spellcheck could do it but currently, according to http://caniuse.com/#feat=spellcheck-attribute :

The partial support in mobile browsers results from their OS generally having built-in spell checking instead of using the wavy underline to indicate misspelled words. spellcheck="false" does not seem to have any effect in these browsers.

like image 118
Fer To Avatar answered Sep 19 '22 14:09

Fer To