PDA

View Full Version : Changing text of the 'Go' Button on Virtual Keyboard



airportyh
12 Jul 2010, 3:46 PM
Hello, first of all Sencha Touch is great work! Congrats and thanks to the authors!

I am in the middle of building a form for creating an object in the app. I see that in the form example, you can create buttons docked to the bottom. I will likely only have one button, and I am wondering whether I can make it respond to hitting the 'Go' button on the virtual keyboard to activate the button. Pretty sure this is possible to do in Safari, not sure if it's supported directly in Sencha Touch, but that's besides the point. The more important point is, if I were to do this, I may want to change the 'Go' label to something with more context, like in my case to 'Create'. Is this possible to do?

evant
12 Jul 2010, 5:19 PM
I had a quick look around on the web and wasn't able to find anything relevant, but I highly doubt it.

If javascript had access to modify something like that, you could do lots of malicious things.

airportyh
12 Jul 2010, 5:55 PM
Thanks for the reply. I haven't been able to find much either. What I did find though, was that w/ Sencha Touch, you can register for the 'submit' event by:

form.on('submit', function(values){
/* do stuff */
})

However, after the submit event, the virtual keyboard stays on the screen and doesn't go away. I doesn't go away because in FormPanel.js, we did a e.preventDefault(), however, that is needed to prevent Safari from actually submitting the page. At this point, it seems that what I am trying to achieve is not possible. I'd love to be proven wrong though.

TommyMaintz
14 Jul 2010, 11:08 AM
I remember this issue. I think I was able to solve it by calling focus() on document.body or something like that.