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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:49:41+00:00 2026-05-15T00:49:41+00:00

I have a single model in CakePHP that has multiple forms on different pages

  • 0

I have a single model in CakePHP that has multiple forms on different pages of the site that I would like to validate differently even where the field name is the same – I have discovered that you can set ‘on’ to create|update which has been a handy discovery but I am wondering if there is any other way of explicitly declaring rules based on the form that was submitted?

Just to rephrase for clarity, form a and form b contain fields of the same name, but if form a is submitted the fields in question should be validated differently than if they were submitted from form b. Possible?

  • 1 1 Answer
  • 1 View
  • 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-15T00:49:42+00:00Added an answer on May 15, 2026 at 12:49 am

    Yes, this has been done before and is possible with the right code. (See links below.)

    The User model is a common place for this technique as you generally want different validation rules when people are submitting account-related forms.

    For example, when registering a user you check if their email address is unique and doesn’t exist in the database, but when resetting a user’s password you instead want to check that their email does exist.

    • MultivalidatableBehavior: Using many validation rulesets per model (Dardo Sordi)
    • Multiple Validation as Behavior in CakePHP 1.2 (Jonathan Snook)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two models that I would like to present in a single Yii
Using EF Code First I have an model object that has multiple properties that
I have two tables that are considered a single entity in my domain model.
I'm currently managing multiple models from a single SITE MANAGER page. I have the
I have A single page that has the following structure <form runat=server><placeholder></placeholder></form> I have
I have a single-threaded application that uses 3 SQLite databases in 3 different files
I have an MVC application with a single model and several views (something like
I have multiple models which relate back to a single model. On save of
I have a bunch of rails models that I'm re-writing into a single model
I have a single model in my django app that I want to create

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.