PDA

View Full Version : dismiss keyboard after form submit



ssdesign
4 Aug 2010, 5:49 PM
Hi,
I dont know how to dismiss the keyboard after the form is submitted.

I tried my sencha app using phonegap on ipad simulator using xcode.
After I press the submit button on a form, the keyboard stays on screen.

Is there a way to get rid of it?
or
Am I doing something wrong with my form panel?

I am hiding the form panel on submit.
Is it right thing to do?

Here is my code:



//////////////////////
// FORM //////////////
//////////////////////
this.formBase = {
scroll: false,
standardSubmit : false,
items: [
{
xtype: 'fieldset',
title: 'Create New',
instructions: 'Please enter the desired name.',
defaults: {
required: true,
labelAlign: 'left'
},
items: [{
xtype: 'textfield',
name : 'name',
label: 'Name',
autoCapitalize : false
}]
}
],
dockedItems: [
{
xtype: 'toolbar',
dock: 'bottom',
items: [
{
xtype: 'spacer'
},
{
text: 'Save',
ui: 'action',
handler: function() {
if(form.getValues().name == "")
{
// Empty
createEmpty();
}
else
{
form.hide();
////////////////////////////////
// start creating new ///////
////////////////////////////////
database.Main.createNew(form.getValues().name);
}
}
}
]
}
]
};