1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    koenoe is on a distinguished road

      0  

    Default Unanswered: [PR4] Prevent a form from submitting

    Unanswered: [PR4] Prevent a form from submitting


    Ext version tested:
    • Sencha Touch 2 PR4
    Browser versions tested against:
    • Chrome 16.0.912.77
    • Safari 5.1.2 (6534.52.7)
    Description:
    • Prevent a form submit by using the config 'submitOnAction' on false and the 'standardSubmit' on true (which is default).
    Steps to reproduce the problem:
    • Just set the config on a 'formpanel' described before.
    The result that was expected:
    • Prevent the form from submitting.
    The result that occurs instead:
    • The form is still submitting and the page refreshes.
    Test Case:
    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. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    Answers
    3101
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    koenoe is on a distinguished road

      0  

    Default


    That's what I've read in the documentation too, but that's exactly what's not happening.