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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:18:00+00:00 2026-05-23T18:18:00+00:00

I have a composite element like below { xtype: ‘compositefield’ ,hideLabel: true ,labelWidth: 100

  • 0

I have a composite element like below

{
    xtype: 'compositefield'
    ,hideLabel: true
    ,labelWidth: 100
    ,items: [
        {
            xtype: 'displayfield'
            ,width: 160
            ,value: 'field 1'
        },
        {
            xtype: 'checkbox',
            name: 'field1name',
            id: 'field1id',
            checked: true
        },
        {
            xtype: 'displayfield'
            ,width: 20
            ,value: 'Ft '
        },
        {
            xtype: 'numberfield',
            width: 50,
            allowNegative: false,
            value: 50,
            name: 'numberfield'     
        }
    ]
}

How can I have a custom validation for the xtype:'numberField'?

I do not want to put the config option allowBlank:false, but instead, I want to validate it somewhere else, but display an error message on the side of the field.

Can anyone please explain to me how to do it?

Below is how I am doing it, which produces “invalid method” error in firebug:

Ext.get('numberfield').setActiveError('this Field Cannot be Blank');

and

Ext.get('numberfield').markInvalid('this Field Cannot be Blank');
  • 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-23T18:18:01+00:00Added an answer on May 23, 2026 at 6:18 pm

    I think easiest is to use a validator function:

    {
        xtype: 'compositefield'
        ,hideLabel: true
        ,labelWidth: 100
        ,monitorValid: true
        ,items: [
            [...]
            {
                xtype: 'numberfield',
                width: 50,
                allowNegative: false,
                value: 50,
                name: 'numberfield',
                validator: function(val) {
                    if (!Ext.isEmpty(val)) {
                        return true;
                    }
                    else {
                        return "Value cannot be empty";
                    }
                }
            }
        ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a composite primary key table (Maintenance Items). I would like to create
We have a composite primary key for the site table defined below. Functionally, this
I have a composite control which emits HTML that looks like this <span id=myControl>
I have a composite element, that initially has a Label. Now I call dispose
I have a new project where I am using GWT-Views like Composite, etc. I
I have a composite c1 website. I like to use the Microsoft Search Server
I have a composite control that contains a ListBox child control. On postback, the
I have a composite control that adds a TextBox and a Label control to
I have a composite control on an ASPX page. There is Javascript on the
I have a composite index on three column in one of my table. It

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.