Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

336
Views
How to show allowBlank error only on form submission?

I have a form with textfield and textareafield, I have provided allowBlank: false to both the columns, but I need to show Red error design and blank error only on form submission not before that. How to do that?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Form fields have two boolean configs, validateOnBlur and validateOnChange. If you set these to false, fields won't be validated during user input. In this case you have add a code for example to your submit button, to check for validation errors. Ext.form.Basic has isValid and hasInvalidField methods that you can call, the first marks validation errors, the second does not.

about 4 years ago · Juan Pablo Isaza Report

0

@Peter Koltai has the correct answer for classic.

For modern you should use:

    validateTextfield(field) {
        test...
        if(!valid){
            field.setErrorMessage('bad decision');
        }
    },
    onBeforeSubmit() {
        const form = this.getView(),
            values = form.getValues(),
            isTextFieldValid = this.validateTextfield(values.fromTextField);
        return isTextFieldValid;
    }
    onSubmit() {
        const isValid = this.onBeforeSubmit();

        if(!isValid) return;

        doMySubmission();
    }

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!