-
2 Feb 2012 4:52 AM #1
Unanswered: [PR4] Prevent a form from submitting
Unanswered: [PR4] Prevent a form from submitting
Ext version tested:- Sencha Touch 2 PR4
- Chrome 16.0.912.77
- Safari 5.1.2 (6534.52.7)
- Prevent a form submit by using the config 'submitOnAction' on false and the 'standardSubmit' on true (which is default).
- Just set the config on a 'formpanel' described before.
- Prevent the form from submitting.
- The form is still submitting and the page refreshes.
Code:Ext.define('TopMec.view.carselection.Search', { extend: 'Ext.form.FormPanel', alias: 'widget.Search', title: 'Car selection', requires: ['Ext.form.FieldSet', 'Ext.field.Text', 'Ext.Button'], config: { fullscreen: true, layout: 'card', scrollable: false, items: [ { height: 47, xtype: 'toolbar', docked: 'top', id: 'mainToolBar', title: '<img src="/libs/images/logo-topmec.png" />', items: [ { xtype: 'button', text: 'Logout', id: 'Logout', cls: 'buttonOrange' } ] }, { xtype: 'formpanel', title: 'Car selection', id: 'searchByLicenseForm', submitOnAction: false, items: [ { xtype: 'fieldset', title: 'Search Vehicle', cls: 'brightBox', items: [ { xtype: 'textfield', label: 'License plate', name: 'licenseplate', clearIcon: false }, { xtype: 'button', text: 'Check', id: 'searchByLicenseButton', cls: 'buttonBlue' }, { xtype: 'button', text: 'VIN number', go: 'SearchVIN', cls: 'buttonGrey' }, { xtype: 'button', text: 'By Brand, Model, Type', go: 'SearchByBrandModelType', cls: 'buttonGrey' }, { xtype: 'button', text: 'Vehicle search history', go: 'VehicleHistory', cls: 'buttonGrey' } ] } ] } ] } });
Is there something wrong with my code, or is it a bug?
-
2 Feb 2012 12:47 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
submitOnAction is a config that if true will allow the form to submit on an action such as pressing <enter> or go on the virtual keyboard. If false it will not allow the form to submit with these kinds of actions.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 Feb 2012 12:06 AM #3
That's what I've read in the documentation too, but that's exactly what's not happening.


Reply With Quote