Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9138747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:17:50+00:00 2026-06-17T09:17:50+00:00

I have a form and there is a button that submits it. I wish

  • 0

I have a form and there is a button that submits it. I wish that submit would be executed only on tap on ‘Register’ button. But when user inputs some text in any textfield and presses “Go” (aka “Enter”) button. The form submits and I can do nothing about it.

This behavior is noticed on Samsung Galaxy S (GT i9000) on Android v2.3.6. But HTC with Android 4 behaves as I wish.

The submitOnAction:false doesn’t help.
beforesubmit too. Any of solutions in code listing don’t work.

I just don’t want the form to submit in any other way except pressing ‘Register’ button!

File /view/userRegistration/FormPanel.js

Ext.define('My.view.userRegistration.FormPanel', {
    extend: 'My.view.components.FormPanel',
    xtype : 'userRegistrationForm',

    config: {
        standardSubmit : false,
        submitOnAction : false,

        listeners: {
            beforesubmit: function(form, values, options, eOpts){
                console.log('before submit fired');
                return false; // returning false doesn't help
            },
            '> field': {
                keyup: function(fld, e){
                    //13 = user tapped 'return' button on keyboard
                    //10 = user tapped 'hide keyboard' on keyboard
                    if (e.browserEvent.keyCode == 13 || e.browserEvent.keyCode == 10) {
                        e.stopEvent();
                        fld.element.dom.blur();
                    }
                }
            }
        },

        items : [
            {
                xtype: 'textfield',
                name : 'firstName',
                required: true,
                listeners: {
                    action: function(field, e, eOpts) {
                    e.stopEvent();
                    return false;
                    },
                    keyup: function(field, e) {
                        if (e.browserEvent.keyCode == 13 || e.browserEvent.keyCode == 10) {
                            // GO pressed on "firstName"
                            e.stopEvent();
                            field.element.dom.blur();
                            return false;
                        }
                    }
                }
            },
            {
                xtype: 'button',
                text : 'Register',
                listeners: {
                    tap: function(button) {
                        var form = button.parent;
                        if (form.isValid()) {
                            form.onSubmit();
                        }
                    }
                }
            }
        ]
    }
});

File /view/components/FormPanel.js

Ext.define('My.view.components.FormPanel', {
    extend : 'Ext.form.Panel',

    onSubmit: function() {
        var fieldValues = this.getValues();
        // Sending fieldValues via AJAX
    },
    isValid: function(args) {
        // Validating values
    }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:17:50+00:00Added an answer on June 17, 2026 at 9:17 am

    The problem was in the onSubmit() method. It is @private in sencha-touch-all-debug.js:

    Ext.define('Ext.form.Panel', {
    
        // @private
        onSubmit: function(e) {
            var me = this;
            if (e && !me.getStandardSubmit()) {
                e.stopEvent();
            } else {
                this.submit();
            }
        }
    
    }
    

    So it is absolutely incorrect to override onSubmit() in child classes. More correct way.

    File /view/components/FormPanel.js

    Ext.define('My.view.components.FormPanel', {
        extend : 'Ext.form.Panel',
    
        config: {
            standardSubmit: false,
    
            listeners: {
                beforesubmit: function(form, values, options, eOpts) {
                    // Do something with data. Send it via AJAX, for example
                    return false; // returning false to prevent real form.submit();
                }
            }
        }
    }
    

    And the button in the form should just call form.submit();.

    File /view/userRegistration/FormPanel.js

            {
                xtype: 'button',
                text : 'Register',
                handler: function() {
                    var form = button.parent;
                    if (form.isValid()) {
                        form.submit();
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with lots of data. There is a Submit button. Upon
I'm constructing a form. No problem there. Aside of a submit button, I have
I have a simple html form that submits information with POST function. But when
I have a form that, when the user submits, and the user is not
I have a page that has a form once the user submits the form
I have a form loading inside my page and there is a button out
I have a php form that submits data to a database. When the form
I have a form. Outside that form, I have a button. A simple button,
I have a form that has three submit buttons as follows: <input type=submit name=COMMAND
I have a jQuery function that submits a form via menu navigation functions: $(function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.