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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:47:15+00:00 2026-05-14T01:47:15+00:00

I know that CakePHP has very good validation out of the box, but I

  • 0

I know that CakePHP has very good validation out of the box, but I want to perform live JS validation on my form before it is submitted.

I’ve played with the jquery validation plugin, which is exactly the kind of thing I want for the front end. (Its for a newsletter subscribe form in a modal box).

The problem is, CakePHP’s validation will redisplay the form containing the error messages if my validation fails. I don’t need this, I just want to return false or redirect should it fail server side.

Does anyone know of any jquery validation that will sit nicely alongside the cakephp automagic form validation, and give me the best of both worlds? Thanks.

  • 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-14T01:47:15+00:00Added an answer on May 14, 2026 at 1:47 am

    You could remove the automatic validation on the Cake side of things, and just use your jquery validation to perform your client side work. Of course, you’ll need to secure the controller so that non-valid fields aren’t saved. To do this, I think you want to turn off the automatic validation in Cake, and make a call in your controller to $this->validates($this->data), which will return false on an invalid data submission. Check out the arguments to Model::save(), as one of them allows a save to complete even with bad data (this is what you want, because otherwise it’ll redisplay the form).

    To sum up, just go ahead and perform your client side validation with jquery. In your controller, check to make sure the data validates before saving it (if Controller::validates returns false, you’ll need to redisplay the form anyhow).

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

Sidebar

Related Questions

I know that this sort of question has been asked here before, but still
For CakePHP errors I know that there exists CakeError and AppError solutions. But I
I know that Phonegap has an event for back button, but it's only available
I know that Java have its own garbage collection, but sometimes I want to
I have a quick question here. I know that the cakePHP find('first') function returns
I know that I can hijack a form by showing a login form in
I know this has probably been answered as it seems a common question but
I have a CakePHP 1.3 application that has a login system, which works well.
Question related to HABTM has been posted in some good numbers on stackoverflow but
Does anyone know of a debugging utility that can debug some cakephp code line

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.