Disable autocorrect and autocomplete on TextBox

Get help using Construct 2

Post » Wed Oct 30, 2013 3:45 pm

Hello !
Does anyone know how to disable autocorrect and autocomplete on TextBox?
I'm trying to make a game where the player has to type words in a TextBox, and iOs keeps suggesting wrong words, and sometimes even replace the player's answers !
I know it's possible to do this in HTML5 (by adding attributes like autocomplete="off") but I don't see the option for this in Construct 2.
Or maybe I should add some javascript to the page that runs the game ?
Any help would be appreciated
B
8
S
4
G
5
Posts: 33
Reputation: 2,818

Post » Wed Oct 30, 2013 9:11 pm

Yeah looks like you have to do it with javascript but you can do it inside C2.
You can give the textbox an ID in properties and you can run javascript with the browser object.


B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sat Nov 02, 2013 7:50 am

I'll try this ! Thanks for your answer.Zoglu2013-11-02 07:50:42
B
8
S
4
G
5
Posts: 33
Reputation: 2,818

Post » Tue Dec 06, 2016 4:12 am

@ramones

Gotta bump this post.
Recently created a project which is being exported to NW.js and has some TextBoxes with CSS.

Now, NW.js apparently saves what I enter in the forms and autocompletes it.
Wouldn't be much of a issue if autocomplete wouldn't cause this ugly yellow-ish overlay which overwrites my CSS:
Image
(Up: normal, bottom: autocomplete)

I tried the javascript way you provided, but that doesn't work. And yes, I set the ID to the same ID as in the javascript.
When googling, I also found html tags to remove autocomplete, but I obviously can't use that in C2.

Any new way of disabling autocomplete for Textboxes?

Thanks everyone.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091


Return to How do I....?

Who is online

Users browsing this forum: JoyfulDreamer, StillSarah and 27 guests