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
Highlighted
Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon
Accepted Solution

Clearing an input?

I am working on making a tag input system in my app.

Currently i have it setup so the user types in an input, and then presses the comma key to insert the tag.

When the comma is pressed, my app makes a div infront of the input, and then clears the input for the next tag.

 

The problem is, the blackberry 10 keyboard still thinks the last word was typed, and when you start typing, it reinserts the previous word you typed.

 

Is there a way to completely clear an input and all blackberry keyboard suggestions?

Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Clearing an input?

Add autocomplete="off" to your input




Click the like button if you find my posts useful!
Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon

Re: Clearing an input?

Would that be the only way? No way to have autocomplete on and still clear it?
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Clearing an input?

From the description it sounded like that was what was causing the issue

 

I take it that ...

 

document.getElementById("input_ID").value = ''; 

 

doesn't work as expected as that's an issue I had a while back




Click the like button if you find my posts useful!
Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon

Re: Clearing an input?

Yeah thats how i am clearing it, but the keyboard thinks the last word is still there
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Clearing an input?

[ Edited ]

I had the same issue and autocomplete="off" fixed it

 

The only way that comes to mind to fix such action _and_ have autocomplete it to give it a different id each time thru Smiley Sad

 

Messy + unnecessary DOM manipulation...




Click the like button if you find my posts useful!
Contributor
Posts: 33
Registered: ‎01-17-2013
My Device: BB10 Dev Alpha Sim
My Carrier: Verizon

Re: Clearing an input?

Ok, i will just have to turn auto complete off for now until this issue is fixed.

 

Thanks!