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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:11:33+00:00 2026-05-27T04:11:33+00:00

I think every framework supports some built in AJAX support so it might be

  • 0

I think every framework supports some built in AJAX support so it might be a general question regarding MVC based development.
What I want to ask is. I have form which submits data via AJAX everything is working fine except that when i submit a form without filling text fields it validates data and the data validation text is getting as response.

I want to avoid this thing not to happen.

  • 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-27T04:11:34+00:00Added an answer on May 27, 2026 at 4:11 am

    Your question is hard to understand (and you have not revised it despite requests to), but I will take a stab at answering ( against my better judgement ;).

    You might have two problems:

    1. You don’t want to validate with AJAX

    If this is the case, looking at your other question you are on the right track as far as I can tell. You can turn off AJAX validation like so:

    <?php $form=$this->beginWidget('CActiveForm', array(
      'id'=>'contacts-form',
      'enableAjaxValidation'=>false, // this turns off AJAX validation
    )); ?>
    

    With enableAjaxValidation set to false empty text fields will no longer be validated with Yii’s built in AJAX validation system.

    1. You don’t have the correct field validation rules set on your Model

    If you don’t want to see errors when submitting blank textfields, then you have an issue with your Model validation rules. It sounds like these fields are set to “required”, and you don’t want them to be. If this is the case, then even if you turn of AJAX Validation, you will get these errors when you validate your model on the regular non-AJAX submit.

    Here is an example:

    class Model extends CActiveRecord {
      public function rules() {
        return array(
            array('oneTextField, anotherTextField', 'required'), // these will error if submitted empty / blank
            array('checkboxField', 'boolean'),
        );
      }
    }
    

    Here is a good place to start learning about Yii’s validation rules for Models: Declaring Validation Rules

    Good luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Every time you read the introduction to an MVC web framework, you meet the
I think every browser has user-controllered full-page zoom nowadays. Is it in anyway accessible
I think I read every single web page relating to this problem but I
I think beestings change the html every time. this means html is not able
I've gone through just about every property I can think of, but haven't found
My fellow programmers did not think to add timestamps to every tables of our
Over the years, I think I have seen and tried every conceivable way of
is it good, that every PHP class implements a Singleton pattern? I think, it
I'm not using any MVC framework and my application structure is rather simple... actions/
I'm writing a webapp using Zend framework and a homebrew widget system. Every widget

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.