Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
jimdouglas
Posts: 2
Registered: ‎04-11-2012
My Device: PlayBook
My Carrier: N/A
Accepted Solution

Can Predictive Input be selectively disabled for a single <input type="text"> element?

[ Edited ]

I've been testing my web apps in a PlayBook, and I've hit a problem with my structured input fields. To handle masked user input, I intercept the low-level keydown and keypress events and construct the text, character by character. Predictive Input breaks this logic by grabbing those key events. You can see the general issue in this JavaScript test page:

 

http://unixpapa.com/js/testkey.html

 

As you type into the input field, no key events are reported.  (Compare against a desktop browser to see the expected events.)

 

Apparently, BlackBerry Java developers can control this functionality at the individual field level by setting the 'TextField.NO_COMPLEX_INPUT' option on a TextField:

 

http://stackoverflow.com/questions/7341482/can-i-turn-off-predictive-input-for-editfield

 

Is there a property I can set on an <input type="text"> element to tell the BlackBerry browser to turn off Predictive Input for this field? In testing this, I've found that I can make it work through the extremely heavy-handed expedient of going into Keyboard settings and turning off 'Show predictions and suggestions' globally, but it's probably not realistic to ask users to do that.

Please use plain text.
BlackBerry Development Advisor (Retired)
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Can Predictive Input be selectively disabled for a single <input type="text"> element?

Yes you can disable predictive text.  Use the "autocomplete" property and set it to off, like this:

 

<input type="text" id="txtText" name="txtText" autocomplete="off" title="Any characters allowed" value="Hello World"/>

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Contributor
jimdouglas
Posts: 2
Registered: ‎04-11-2012
My Device: PlayBook
My Carrier: N/A

Re: Can Predictive Input be selectively disabled for a single <input type="text"> element?

Awesome, couldn't be any easier.  I just confirmed that this fixes my structured edit controls in the PlayBook browser; thanks Adam!

Please use plain text.