Have you found yourself wanting to remove validation on a specific field in a specific form? Yes? Excellent, you found the right place.
If you haven’t had the need for this, a great example of where you would want to accomplish this would be in a users edit form. Normally in CakePHP we would encrypt the password, especially if you are using the AuthComponent, so we wouldn’t want the password prefilled on our form. Instead, we’ll make it blank and place a note underneath that says “Only enter a password if you wish to change it”.
The above shouldn’t be difficult, however, when you go to use the form, you will get some unexpected results. I keep getting a message saying that I must enter a password, because I had setup validation on that field for the registration process. Below is a simple solution to this problem. (more…)