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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:25:43+00:00 2026-05-27T09:25:43+00:00

I have the following problem: I need to validate data in a controller, which

  • 0

I have the following problem:
I need to validate data in a controller, which is passed by a form. The special thing: The fields from the form are not present in the database, BUT in the $validate-Array. – Which should afaik not be a problem.
Another thing is, that the Model has a hasMany-Relationship with parts of this form.

Text hasMany Proofs

This is the validation-array:

var $validate = array(  
   'freetext' => array(  
      'between' => array(  
          'rule' => array('between', 250, 1000),  
          'message' => '..',  
      ),  
   ),  
);  

Here is an example of the data passed to the controller

[Proof] => Array
    (
        [0] => Array
            (
                [freetext] => asd
            )
        [1] => Array
            (
                [freetext] => asd
            )
        [2] => Array
            (
                [freetext] => asd
            )
    )

I use the following code to validate:

$this->Texts->set($this->data);   
if ($this->Texts->validates()) {  

When I call it, it returns true, so the validation succeed. BUT freetext has a bit less than 250 chars.

But: The form shows the red asterisks, which symbolizes me, that the validation-array is succesfully parsed an applied to the form.
And also in the corresponding controller beforeValidate() { debug($this->data); } shows me the correct data.

So WHY does data validation succeed, even when the policies are not me?

Thanks ahead!
~MxAgent

  • 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-27T09:25:44+00:00Added an answer on May 27, 2026 at 9:25 am

    Updated to cakePHP 2.0 and used validateMany() for validation. Now it works 😉

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

Sidebar

Related Questions

I have the following problem: I need to get a ConfigurationSection - object from
I have the following problem: I have a form I need to serialize but
I have the following problem i need in array 3 the languages names not
I have a problem with a JSF composite which validates internal input fields. Following
I have the following problem: We need to find the next august. I other
I have the following problem: I need to use XSLFO to generate a 2-column
I have the following problem in my Data Structures and Problem Solving using Java
I have the following problem. If I query values with a keyfigure which is
I have a situation that if my form doesn't validate I need it to
We have following problem. Developers frequently need to make small changes to our web

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.