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 4032700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:45:15+00:00 2026-05-20T11:45:15+00:00

i want to use this.form.markInvalid directly from the form. i have 2 items in

  • 0

i want to use this.form.markInvalid directly from the form.

i have 2 items in my form:

code:

  items: [
            { 
            fieldLabel: 'Name',
            name: 'name'
            }
            ,{
            id: 'e' ,
            fieldLabel: 'Email',
            name: 'email'
        }]

when the user click on a button i am calling this.form.markInvalid({'e':'email is invalid'});

i want to mark email item as invalid with the error message: “email is invalid”.

But i get an error message when i press the button:

this.form is undefined
 this.form.markInvalid({'e':'email is invalid'}); 

Thx

  • 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-05-20T11:45:16+00:00Added an answer on May 20, 2026 at 11:45 am

    In the button handler/listener did you define the correct scope?

    The function that is registered to the click event should have access to the this.form property. this in your case probably points to the button itself instead of the the formPanel.

    You can easily change the scope of the listener by using createDelegate() or adding an extra argument when registering your listener like this:

    myButton.on('click', function(){
        console.log(this, this.id);
    }, this); // <= notice the "this" argument here!
    

    BUT!
    Why are you validating your email like this? You could as easily add a vtype to your field config and let ExtJS do it all for you.

    items: [{ 
        fieldLabel: 'Name',
        name: 'name'
    },{
        id: 'e' ,
        fieldLabel: 'Email',
        name: 'email',
        vtype: 'email'
    }]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this easy little form in my JavaFX application. I want to use
I want use page that has this form: <form method=post action=modules.php?name=search> <input onkeypress=FKeyPress(this); onkeydown=FKeyDown(this);
I want use this 1 for using Bar code or QR code scanner. I
I want to use this C code in my C++ project : mysql.c :
I want to use this regular expression in Python: <(?:[^]*[']*|'[^']*'[']*|[^'>])+> (from RegEx match open
I want to use this line of code: using (ADataContext _dc = new ADataContext(ConnectionString),
I'm new to jQuery but want to use this form validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ In
I want use a RegularExpressionValidator for a date in this form yyyy-mm-dd (example: 2012-11-29)
I have a global form which I want to use the same form every
So I have an input form that I want to use to update a

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.