Re: Validate fields
Alternatively, if this is an update form - if you don't want to update
the password for example, and therefore leave it blank, by simply not
validating you will update your password to a blank password. Not
what you're intending, I'd imagine.
If password is set to notEmpty or required, make sure it's "on" =>
"create" and simply unset any fields that are empty (the index) from
the data array in your model's beforeSave callback.
On Jan 5, 11:33 pm, frmdstryr <frmdst...@gmail.com> wrote:
> you set the validation rules in the Model of whatever your using (i'm
> guessing users model) /app/models/user.php
> search for cakephp validation in google and look in the cakephp
> manual, it should be what you need.
>
> On Jan 5, 6:53 pm, kicaj <ki...@kdev.pl> wrote:
>
>
>
> > How validate field only we entered some value into input?
>
> > For example:
> > I have form with fields: username, password and email
> > I set 'value'=>'' in edit template for password input field
> > When I edit this fields, I want update filed password only when I
> > wrote some new password, but when I lost empty field password, this
> > field will be not updated. This works, but:
> > How validate field when only wrote into?
>
> > If field value is empty we not validate, but if field value is not
> > empty we get rules from $validate...
>
> > How do this?- Hide quoted text -
>
> - Show quoted text -
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home