Re: Validation causes memory exhausting

2010-10-14 Thread senser
No, I don't use isUnique validation rule. Here is my $validation array: var $validate=array( 'for_date'=>array('required'=>VALID_NOT_EMPTY, 'date'=>array('rule'=>array('date', 'ymd')), 'length'=>arr

Re: Validation causes memory exhausting

2010-10-13 Thread Dr. Loboto
What validation rules do you use? If there is isUnique, for example, for each check it makes database query, result is saved in memory (if cacheQueries is on) and query string is saved in SQL log (if debug is 2). On Oct 13, 5:15 pm, senser wrote: > Hello, > > I try to save a large

Validation causes memory exhausting

2010-10-13 Thread senser
;true)), but even with 1024MB memory limit, script fails. I've tried to save each record with loop and $Model->save($data) instead of $Model->saveAll(), but this makes no difference. Disabling validation makes the trick though. When records are not validated script consumes (almost) consta

Re: Incorrect redirect after validation error

2010-10-10 Thread euromark
Your page has been saved."); >                 $this->redirect(array("action" => "index")); >             } >         } else { >             $this->set("authors", $this->SimplePage->Author->find("list", > array("fields" => array("disp

Incorrect redirect after validation error

2010-10-10 Thread Sebastian
index")); } } else { $this->set("authors", $this->SimplePage->Author- >find("list", array("fields" => array("displayname"; $this->render("admin_edit"); } } Everything is

Re: CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread Dr. Loboto
'required' key serves not existent fields, false by default. var $validate = array( 'name' => array( 'notempty' => array( 'rule' => array('notempty'), 'required' => true // this rule wil

Custom validation rules and saveAll

2010-09-30 Thread Ernesto
hello. i have 2 models Article hasMany Component in my Component model i wrote a custom validation rule that relies on data from Article model. how can i get this data? $this->Article->find doesn't work because that function loads data from the database.. and i need the going-to-be

Re: CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread Joshua Muheim
clearly doesn't seem to be able >> to come even close to the experience of RoR. Any yes, I know CakePHP >> isn't RoR, and yes, I could switch (well actually, I can't)... Just my >> 2 c€nts... >> >> >> >> On Thu, Sep 30, 2010 at 2:58 PM

Re: CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread euromark
the experience of RoR. Any yes, I know CakePHP > isn't RoR, and yes, I could switch (well actually, I can't)... Just my > 2 c€nts... > > > > On Thu, Sep 30, 2010 at 2:58 PM, euromark wrote: > > actually it is NOT a bug > > although many are not aware of that

Re: CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread Joshua Muheim
isn't RoR, and yes, I could switch (well actually, I can't)... Just my 2 c€nts... On Thu, Sep 30, 2010 at 2:58 PM, euromark wrote: > actually it is NOT a bug > although many are not aware of that behavior :) > > you need to make sure that the field is passed to the vali

Re: CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread euromark
actually it is NOT a bug although many are not aware of that behavior :) you need to make sure that the field is passed to the validation otherwise it will be ignored @see http://www.dereuromark.de/2010/09/21/saving-model-data-and-security/ On 30 Sep., 14:52, psybear83 wrote: > Hi everyb

CakePHP ignores notEmpty validation rule when the field's name is not a key in $data! (Bug or Feature?)

2010-09-30 Thread psybear83
Hi everybody I have baked the following very straight-forward model: class Post extends AppModel { var $name = 'Post'; var $displayField = 'name'; var $validate = array( 'name' => array( 'notempty' => array(

Re: Redirection based on validation results.

2010-09-29 Thread j.blotus
that or create a separate function to search for an existing user before adding instead of using cake's validation rules On Sep 29, 1:00 pm, Anthony wrote: > > It sounds like you are saving a record right? When you are done with > > your $this->Model->save(), the id o

Re: Redirection based on validation results.

2010-09-29 Thread j.blotus
done.  When a new player is saved the > redirect takes you to the action that displays information about the > single user based on the newly created ID. > > > > > Why would you want to redirect during validation? Validation is > > generally for the saving and updating of

Re: Redirection based on validation results.

2010-09-29 Thread Anthony
edirect takes you to the action that displays information about the single user based on the newly created ID. > > Why would you want to redirect during validation? Validation is > generally for the saving and updating of records, are you trying to > interrupt that? Or am I misreading

Re: Redirection based on validation results.

2010-09-29 Thread j.blotus
It sounds like you are saving a record right? When you are done with your $this->Model->save(), the id of the record will be in $this- >Model->id and you can redirect from there in the controller. Why would you want to redirect during validation? Validation is generally for th

Redirection based on validation results.

2010-09-29 Thread Anthony
Each server has many players and players belong to a server. Each player may have the same first and last name but only one per server. I have a custom validation that is working correctly when the form is submitted. My thoughts were to kill two birds with one stone and have the validation

Check for validation errors in a view

2010-09-28 Thread Matthias
Hi, can i somehow see *in a view* whether a forma validation error occurred? Like: if ($form->hasErrors() ) echo 'there was an error'; else echo 'please edit the entry'; Or can i only check for that in the controller and have to pass a variable to the view? Ch

Re: how to use required => true in multiple validation

2010-09-25 Thread euromark
; doesn't really test its value. So in your case, required => true might > > >> be enough. > > > >> Jeremy Burns > > >> Class Outfit > > > >> jeremybu...@classoutfit.comhttp://www.classoutfit.com > > > >> On 25 Sep 2010, a

Re: how to use required => true in multiple validation

2010-09-25 Thread Mariano C.
s that the field must be present in the data array, and > >> doesn't really test its value. So in your case, required => true might be > >> enough. > > >> Jeremy Burns > >> Class Outfit > > >> jeremybu...@classoutfit.comhttp://www.classoutfi

Re: how to use required => true in multiple validation

2010-09-25 Thread euromark
assoutfit.comhttp://www.classoutfit.com > > >> On 25 Sep 2010, at 12:20, Mariano C. wrote: > > >>> Reading the doc there's explained that require isn't a "pure" rule, so > >>> I'm asking how can I use it in multipl

Re: how to use required => true in multiple validation

2010-09-25 Thread Jeremy Burns | Class Outfit
t; On 25 Sep 2010, at 12:20, Mariano C. wrote: >> >> >> >>> Reading the doc there's explained that require isn't a "pure" rule, so >>> I'm asking how can I use it in multiple validation per field case: >> >>> exampl

Re: how to use required => true in multiple validation

2010-09-25 Thread euromark
t; jeremybu...@classoutfit.comhttp://www.classoutfit.com > > On 25 Sep 2010, at 12:20, Mariano C. wrote: > > > > > Reading the doc there's explained that require isn't a "pure" rule, so > > I'm asking how can I use it in

Re: how to use required => true in multiple validation

2010-09-25 Thread Jeremy Burns | Class Outfit
bu...@classoutfit.com http://www.classoutfit.com On 25 Sep 2010, at 12:20, Mariano C. wrote: > Reading the doc there's explained that require isn't a "pure" rule, so > I'm asking how can I use it in multiple validation per field case: > > example:

how to use required => true in multiple validation

2010-09-25 Thread Mariano C.
Reading the doc there's explained that require isn't a "pure" rule, so I'm asking how can I use it in multiple validation per field case: example: var $validate = array ( 'id' => array( 'idRule-1&

Re: Form validation errors

2010-09-18 Thread Dr. Loboto
fit > > wrote: > >> I have *really* solved it now. In my app_controller I had var > >> $persistModel = true; which I was lead to believe was a *good thing* from > >> a performance point of view. If I comment out that line my problem > >> disappears and I

Re: Form validation errors

2010-09-17 Thread Jeremy Burns | Class Outfit
line my problem disappears and I >> reliably get validation messages on screen. >> >> Before I leave this, can anyone shed any more light on this? Is this >> behaviour correct, and what is the impact of leaving out persistModel? >> >> Jeremy Burns >> Class Ou

Re: Form validation errors

2010-09-17 Thread Dr. Loboto
*good thing* from a performance point > of view. If I comment out that line my problem disappears and I reliably get > validation messages on screen. > > Before I leave this, can anyone shed any more light on this? Is this > behaviour correct, and what is the impact of lea

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
I have *really* solved it now. In my app_controller I had var $persistModel = true; which I was lead to believe was a *good thing* from a performance point of view. If I comment out that line my problem disappears and I reliably get validation messages on screen. Before I leave this, can

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
I jumped the gun. After I cleared the cache I resubmitted the form and got the validation error messages. Deep joy. I closed the ticket and told the world my problem was solved. Then I resubmitted the form again - and no validation messages. This is repeatable: clear the cache, submit the form

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
out and the code is not erroring > before or after the saves; the saves are happening and failing, producing > validation errors. > > I have created a variable ($validationErrors) and added the validationErrors > as they occur (so at one point the array looks like > $validati

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
g and failing, producing validation errors. I have created a variable ($validationErrors) and added the validationErrors as they occur (so at one point the array looks like $validationErrors['OrderAddress']['field_name'] => 'message'). I have added some deb

Re: Form validation errors

2010-09-16 Thread Dr. Loboto
Output get_class($this->MyModelThatDontValidate) or call custom model method to check that models are really loaded. Also check that you approach save() or validates() call in controller and don't get error before that abandon save/validation. Be sure that debug > 0. In most of cases

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
ен, 20:52, Jeremy Burns wrote: >> I'm a bit stumped. I've developed some code on my local machine (MAMP) >> and when a form fails validation I get the right error messages >> displayed in the right places. I have used the form helper to create >> the form and the inputs,

Re: Form validation errors

2010-09-16 Thread Dr. Loboto
99.9% - your models are not loaded at all because you named them not in lowercase. On 16 сен, 20:52, Jeremy Burns wrote: > I'm a bit stumped. I've developed some code on my local machine (MAMP) > and when a form fails validation I get the right error messages > displayed in

Form validation errors

2010-09-16 Thread Jeremy Burns
I'm a bit stumped. I've developed some code on my local machine (MAMP) and when a form fails validation I get the right error messages displayed in the right places. I have used the form helper to create the form and the inputs, but have not used any code to produce the error messa

Re: Mdy date validation fails for Sep instead of Sept

2010-09-14 Thread BrendonKoz
rmat is Day Month Year as > in  1 Sep 2010 or 1-9-2010 > Programatically in SQL we use year-month-day hour:min:second.micro. > 2010-09-01 12:00:00.123 > ISO 8601 2004-02-12T15:19:21+00:00 > As validation is for verifying data input we need to consider the > mindset of the community t

Re: Mdy date validation fails for Sep instead of Sept

2010-09-14 Thread BrendonKoz
ramatically in SQL we use year-month-day hour:min:second.micro. > 2010-09-01 12:00:00.123 > ISO 8601 2004-02-12T15:19:21+00:00 > As validation is for verifying data input we need to consider the > mindset of the community that will be using our software and provide > the proper conversions from

Re: Mdy date validation fails for Sep instead of Sept

2010-09-14 Thread LunarDraco
as in 9-1-2010 this represents 9 Jan 2010. All most everywhere else on the planet the format is Day Month Year as in 1 Sep 2010 or 1-9-2010 Programatically in SQL we use year-month-day hour:min:second.micro. 2010-09-01 12:00:00.123 ISO 8601 2004-02-12T15:19:21+00:00 As validation is for verifying

Re: URL Validation

2010-09-14 Thread euromark
parse_url() and use its return values On 14 Sep., 13:52, Andrei Mita wrote: > You could use a couple of the string functions found > here:http://php.net/manual/en/ref.strings.php > > > > On Tue, Sep 14, 2010 at 6:05 AM, Dave Maharaj wrote: > >  Anyone know how to strip everything from a url so

Re: URL Validation

2010-09-14 Thread Andrei Mita
You could use a couple of the string functions found here: http://php.net/manual/en/ref.strings.php On Tue, Sep 14, 2010 at 6:05 AM, Dave Maharaj wrote: > Anyone know how to strip everything from a url so your left with > http://www.site.com ? > > So if user enters http://www.site.com/somethin

URL Validation

2010-09-13 Thread Dave Maharaj
Anyone know how to strip everything from a url so your left with http://www.site.com ? So if user enters http://www.site.com/something or www.site.com/anything So basically remove everything after the domain extension and add http: to the www if it was left out. Thanks, Dave Ch

Re: Mdy date validation fails for Sep instead of Sept

2010-09-13 Thread Imaginextra
[13579][26])|((16|[2468][048]| [3579][26])00)))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/'; not recommended to mess with the core but it works. On Aug 4, 5:03 pm, Brenda wrote: > I have event_date in my model, with this validation rule: > >         'event_date' => arr

Re: isUnique validation on edit action of User model

2010-09-11 Thread cricket
On Fri, Sep 10, 2010 at 7:34 PM, Lance wrote: > Got it figured out!  I kept using the debug(); function until my > variable values made sense. > I hope this helps people who are trying to validate against the > database while editing a user. > It makes sure the value isUnique.  Just adjust the fie

Re: isUnique validation on edit action of User model

2010-09-10 Thread Lance
#x27;], array('User.id' => $this->data['User'] > > > ['id']  ) > > >                 { > > >                         $this->invalidate('username_unique'); > > >                         return false; > > >

Re: isUnique validation on edit action of User model

2010-09-10 Thread Lance
his->invalidate('username_unique'); > >                         return false; > >                 } > >                 return true; > >         } > > > On Sep 10, 12:23 pm, cricket wrote: > > > > On Fri, Sep 10, 2010 at 3:21 PM, cricket wrot

Re: isUnique validation on edit action of User model

2010-09-10 Thread Lance
false; >                 } >                 return true; >         } > > On Sep 10, 12:23 pm, cricket wrote: > > > On Fri, Sep 10, 2010 at 3:21 PM, cricket wrote: > > > On Fri, Sep 10, 2010 at 3:06 PM, Lance wrote: > > >> I actually want to check isUniqu

Re: isUnique validation on edit action of User model

2010-09-10 Thread Lance
Lance wrote: > > >> I actually want to check isUnique if they edit their username or email > > >> address. > > >> I want it to check their changed username or email against the > > >> database to make sure it already doesn't exist. > > &

Re: isUnique validation on edit action of User model

2010-09-10 Thread Lance
l > >> address. > >> I want it to check their changed username or email against the > >> database to make sure it already doesn't exist. > >> Sorry for the confusion.  Thanks again! > > > My fault, I didn't read that carefully. > > > In t

Re: isUnique validation on edit action of User model

2010-09-10 Thread cricket
ake sure it already doesn't exist. >> Sorry for the confusion.  Thanks again! > > My fault, I didn't read that carefully. > > In this case, you could create a validation method that fetches both > the ID and the value of whichever column you're checking. If it ex

Re: isUnique validation on edit action of User model

2010-09-10 Thread cricket
nks again! My fault, I didn't read that carefully. In this case, you could create a validation method that fetches both the ID and the value of whichever column you're checking. If it exists AND the ID is not the current model ID then return false. During validation, you can check $this-

Re: isUnique validation on edit action of User model

2010-09-10 Thread Lance
> > If I add isUnique in $validate array it always isUnique and will throw > > an error.  Any help would be greatly appreciated! > > Add 'on' => 'create' to the validation options. The rule will be > ignored for existing records. Check out the new Cak

Re: isUnique validation on edit action of User model

2010-09-10 Thread cricket
dd isUnique in $validate array it always isUnique and will throw > an error.  Any help would be greatly appreciated! Add 'on' => 'create' to the validation options. The rule will be ignored for existing records. Check out the new CakePHP Questions site http://cakeqs.or

isUnique validation on edit action of User model

2010-09-10 Thread Lance
I have a User model and I want to allow logged in users to edit their username or email address if they would like. I just want the username or email address that they've changed to check against the database to make sure it's unique. I'm using a beforeValidate method on the sign up process to ch

Re: Validation translations

2010-09-10 Thread Dmitry Shevchenko
Thank you Sanza and Dr. Loboto I've tried Sanza's example and it works. I will try a Dr. Loboto example lately. Thank you!!! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to t

Re: Validation translations

2010-09-09 Thread Dr. Loboto
Or you can define your invalidate() function in app_model: public function invalidate($field, $value = true) { if (is_string($value)) { return parent::invalidate($field, __($value)); } else { return parent::invalidate($field); } } Or you can try not use messages in

Re: Validation translations

2010-09-09 Thread Sanza
Hi I don't know if can help you, but to manage translation of error messages i use this system. I think is much clean and simply: I put the all declaration of validate array inside the constructor of the model: function __construct($id = false, $table = null, $ds = null){

Validation translations

2010-09-09 Thread Dmitry Shevchenko
Hi. I have a problem with translation validation messages. seems it didn't takes from view. I have a validation rules for field, it looks like: 'looking_agegroup_to' => array( 'checkRange'=>array (

Re: Data validation: check whether at least one of many fields has a value?

2010-09-08 Thread Joshua Muheim
: > Thanks for this useful hint, euromark! > > On Tue, Sep 7, 2010 at 5:04 PM, euromark wrote: >> if would use !empty() !!! >> because the fields can be empty strings and will still pass validation >> >> >> On 7 Sep., 16:59, Joshua Muheim wrote: >>> Thank

Re: Preserving value in dependent select list after validation

2010-09-08 Thread aveev
d value for dependent select > > list option in controller. > > So my question is, how can I display options in dependent select list > > with correctly selected value  if validation fails ? > > > What I'm thinking now is that I set a variable  in controller when >

Re: Data validation: check whether at least one of many fields has a value?

2010-09-08 Thread Joshua Muheim
Thanks for this useful hint, euromark! On Tue, Sep 7, 2010 at 5:04 PM, euromark wrote: > if would use !empty() !!! > because the fields can be empty strings and will still pass validation > > > On 7 Sep., 16:59, Joshua Muheim wrote: >> Thank you! :-) >> >> On Tu

Re: Preserving value in dependent select list after validation

2010-09-07 Thread cricket
correctly selected value  if validation fails ? > > What I'm thinking now is that I set a variable  in controller when > validation fails. This variable will be passed to jquery.(this creates > another problem that I don't quite understand, which is passing > variable fr

Re: Data validation: check whether at least one of many fields has a value?

2010-09-07 Thread euromark
if would use !empty() !!! because the fields can be empty strings and will still pass validation On 7 Sep., 16:59, Joshua Muheim wrote: > Thank you! :-) > > On Tue, Sep 7, 2010 at 3:12 PM, Jeremy Burns | Class Outfit > > wrote: > > Here's an example:

Re: Data validation: check whether at least one of many fields has a value?

2010-09-07 Thread Joshua Muheim
Thank you! :-) On Tue, Sep 7, 2010 at 3:12 PM, Jeremy Burns | Class Outfit wrote: > Here's an example: > The validation rule is: > > 'phone_home' => array( > 'hasOnePhone' => array( > 'rule' => 'hasOnePhone', >

Re: Data validation: check whether at least one of many fields has a value?

2010-09-07 Thread Jeremy Burns | Class Outfit
Here's an example: The validation rule is: 'phone_home' => array( 'hasOnePhone' => array( 'rule' => 'hasOnePhone', &

Data validation: check whether at least one of many fields has a value?

2010-09-07 Thread psybear83
Hi all I'm seeing how to have many validation rules for one field everywhere, but I couldn't figure out how to have on validation rule that depends on many fields?! I have a model with 3 fields. I want to check that at least one of these fields has a value. How can I achieve this? Th

Re: Preserving value in dependent select list after validation

2010-09-06 Thread aveev
I think you misunderstood my question. What I'm talking about is if the validation fails. In controller I don't do any redirect if validation fails. It simply sets errors variable to be passed to add view and the view is rendered with previously entered values along with error messages.

Re: Model validation for multiple actions

2010-09-06 Thread Maurits van der Schee
Hi, You need to look into the Auth component, validation has nothing to do with it. Validation is about accepting data for save in the database Authenthication is about finding out who the user is Authorization is about telling what actions may be executed. So you want authentication and

Re: Model validation for multiple actions

2010-09-06 Thread AD7six
On Sep 6, 11:40 am, amin wrote: > Hi, > > Can u plz help me out, how to call validation for multiple actions of > a controller The action and validation are not dependent - related. > > E.g. a user controller, in user controller add, signup, forgot > password .. etc a

Model validation for multiple actions

2010-09-06 Thread amin
Hi, Can u plz help me out, how to call validation for multiple actions of a controller E.g. a user controller, in user controller add, signup, forgot password .. etc are actions now in model class User extends AppModel{ } how to validate mentioned actions validation in User model I have

Model validation for multiple actions

2010-09-06 Thread amin
Hi, Can u plz help me out, how to call validation for multiple actions of a controller E.g. a user controller, in user controller add, signup, forgot password .. etc are actions now in model class User extends AppModel{ } how to validate mentioned actions validation in User model I have

Re: Validation doesn't give me errors

2010-09-05 Thread philn
Hey, I had this problem too and I found out that the validation is only activated when you call save(). You can also do it manually by calling validates() as mentioned here: http://book.cakephp.org/view/410/Validating-Data-from-the-Controller Kind regards, philn On Sep 4, 7:09 pm, Simon wrote

Re: Preserving value in dependent select list after validation

2010-09-05 Thread Jeremy Burns | Class Outfit
urns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 3 Sep 2010, at 05:14, aveev wrote: > Hi, I'm new to cakephp > I'm trying to create an applicant add form with validation.. > If validation fails, it should return to the add page with previously > entere

Re: call model validation for multiple actions

2010-09-05 Thread Jeremy Burns | Class Outfit
If you have your validation rules set up in the model, they will automatically be triggered each time you do any save action against the model - that is, unless you have changed something to prevent it. You don't need to call the validate method at all. You can, however, do if ($this->M

Validation doesn't give me errors

2010-09-04 Thread Simon
Hello everyone, I try to get validation working on a register-form in my application. Because it did not work at all, I tried it on a very simple form with only a username field (it's called 'gebruikersnaam' in the code because i'm belgian). I allready did var_dump on $

call model validation for multiple actions

2010-09-04 Thread amin
Hi, Can u plz help me out, how to call validation for multiple actions of a controller E.g. a user controller, in user controller add, signup, forgot password .. etc are actions now in model class User extends AppModel{ } how to validate mentioned actions validation in User model I have

Preserving value in dependent select list after validation

2010-09-04 Thread aveev
Hi, I'm new to cakephp I'm trying to create an applicant add form with validation.. If validation fails, it should return to the add page with previously entered values. Here's the code snippet //applicant controller function add() { $docTypes = $this->Docume

Re: Data validation before submit

2010-08-28 Thread sanedevil
Thanks Sam. I think i'll settle on jquery validation. i hope cake integrates jquery validation. On Aug 28, 2:56 am, Sam wrote: > In the past I've used ajax to send fields to the controller to > validate as they are changed- it is a bit slower than full client-side > validatio

Re: Data validation before submit

2010-08-27 Thread Sam
In the past I've used ajax to send fields to the controller to validate as they are changed- it is a bit slower than full client-side validation but is way easier to maintain. On Aug 27, 8:34 am, sanedevil wrote: > ah! sorry. i wanted to ask regarding client-side form validation. >

Re: Data validation before submit

2010-08-27 Thread sanedevil
ah! sorry. i wanted to ask regarding client-side form validation. apparently, this can't be done with cake. if it can be, please lemme know how. On Aug 27, 8:25 am, Jeremy Burns | Class Outfit wrote: > See:http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller > > if

Re: Data validation before submit

2010-08-26 Thread Jeremy Burns | Class Outfit
See: http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller if ($this->Model->validates()): or, from within the model of the data you want to validate... if ($this->validates()): Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 26 Aug 2010, a

Data validation before submit

2010-08-26 Thread sanedevil
heya! is there a way to validate the data before submission using Cake? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to

Re: Validation of Foreign Keys - Not Automatic ?

2010-08-24 Thread Sam
AFAIK, cake doesn't have this built in, however if you use InnoDB mysql tables you can use Foreign Key Constraints, which should give you what you want. http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html On Aug 23, 8:30 pm, rvandervort wrote: > Sorry that should read   "  

Re: Validation of Foreign Keys - Not Automatic ?

2010-08-23 Thread rvandervort
Sorry that should read " 'Player' => array( 'Player' => 'Player' " On Aug 23, 9:15 pm, rvandervort wrote: > I'm not sure why, but expected models related by belongsTo and hasMany > to be "autovalidated". > > e.g. > > class Team extends AppModel  { >   var $hasMany = array( >          'Play

Validation of Foreign Keys - Not Automatic ?

2010-08-23 Thread rvandervort
I'm not sure why, but expected models related by belongsTo and hasMany to be "autovalidated". e.g. class Team extends AppModel { var $hasMany = array( 'Player' => array( 'Player' => 'Item' , 'foreignKey' => 'team_id' ) ); } class Player extends AppModel { var $belongsTo = array(

Re: Validation a la "either...or"

2010-08-23 Thread DerBjörn
Thanks for this advice. Anyway... casting doesn't solve the problem that 'null' sets me the column on the standard value. What i do if p.e. the standard value of a column is 1.? Of course i can check all fields in the beforeValidate function, but it should be a little more flexible and working

Re: Validation a la "either...or"

2010-08-18 Thread euromark
ray( >                                 'rule' => array('numeric'), >                                 //'message' => 'Your custom message here', >                                 'allowEmpty' => true, >                          

Re: Validation a la "either...or"

2010-08-18 Thread DerBjörn
//'message' => 'Your custom message here', 'allowEmpty' => true, //'required' => false, //'last' => false, // Stop validation after this r

Conditional validation on multiple records

2010-08-17 Thread tersmitten
I have an array of data that I want to validate. Like this: $this->data['Model'][0]['field1'] $this->data['Model'][0]['field2'] $this->data['Model'][0]['field3'] $this->data['Model'][1]['field1'] $this->data['Model'][1]['field2'] $this->data['Model'][1]['field3'] $this->data['Model'][2]['field1']

Re: How can I display CakePHP input validation errors in a different container input

2010-08-16 Thread Miles J
Do you mean something like this? http://milesj.me/blog/read/10/Displaying-Form-Errors-As-A-List-In-CakePHP On Aug 15, 8:35 am, euromark wrote: > if you bake your views/forms > this should be done automatically > > IF you set up your model relations accordingly anyway > maybe somethings wrong her

Validation errors not being displayed

2010-08-16 Thread Mike
x27;Next'); And in my controller action for this view I have something like: $this->Order->DeliveryContact->set($this->data['DeliveryContact']); if ($this->Order->DeliveryContact->validates()) { proceedToNextStep(); } The validation errors are not being pul

Re: How can I display CakePHP input validation errors in a different container input

2010-08-15 Thread euromark
if you bake your views/forms this should be done automatically IF you set up your model relations accordingly anyway maybe somethings wrong here you should post your code for details On 15 Aug., 16:30, Petr Vytlačil wrote: > Hi I will try to describe my problem better: > > I have database table

Re: How can I display CakePHP input validation errors in a different container input

2010-08-15 Thread Jeremy Burns | Class Outfit
Make some deliberate input errors in your form, and then place this in your Address model code: die(debug($this->validationErrors)); This will show you the output of your validation errors array, and then you'll know what values to extract and display. Jeremy Burns Class Outfit

Re: How can I display CakePHP input validation errors in a different container input

2010-08-15 Thread Petr Vytlačil
Hi I will try to describe my problem better: I have database tables addresses and user so i have two models User and Address. User haveone malingaddress (class Address) and billaddress (class Address) this is definate in model User. How is registration form where are inputs for information about u

Re: How can I display CakePHP input validation errors in a different container input

2010-08-15 Thread Zaky Katalan-Ezra
Same here Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe fro

Re: How can I display CakePHP input validation errors in a different container input

2010-08-15 Thread rez...@gmail.com
what's meant of redirect this errors for concrete input or group inputs ? really I want to help you Sorry , I can't understand what you want Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are

Re: How can I display CakePHP input validation errors in a different container input

2010-08-13 Thread Petr Vytlačil
Nobody know solution? On 13 srp, 13:22, Petr Vytlačil wrote: > Hi is any way how i can display input validation errors in different > container input? > For examle a have model address and user model has deliver and billing > address sou a need in form for greate user account twic

How can I display CakePHP input validation errors in a different container input

2010-08-13 Thread Petr Vytlačil
Hi is any way how i can display input validation errors in different container input? For examle a have model address and user model has deliver and billing address sou a need in form for greate user account twice inputs for address. $form->input(Deliveraddress.street); $form->

Re: Calling Validation->cc() from the controller

2010-08-13 Thread Wilhelm
7;CreditCard'); > > > >        $creditCard->set( $this->data ); > > > >        if ($creditCard->validates($this->data['CreditCard'])): > > > >                $this->Session->write('creditCard', > > >    

Re: Calling Validation->cc() from the controller

2010-08-13 Thread Wilhelm
creditCard', > >                        array( > >                                'card_type' => > > $this->data['CreditCard']['card_type'], > >                                'card_number' => > > $this->data[&

<    2   3   4   5   6   7   8   9   10   11   >