Re: Model Validation

2014-07-31 Thread Stephen S
& get it on success method of ajax. The > problem arising How can I show these error message . > > I want model validation using ajax > > > On Wednesday, 30 July 2014 14:59:03 UTC+5:30, Dr. Tarique Sani wrote: > >> Start here http://bit.ly/UKovlN >> >>

Re: Model Validation

2014-07-31 Thread Sudhir Pandey
Thanks for your response , but I submitting the form by ajax & then validate. I have encode the error & get it on success method of ajax. The problem arising How can I show these error message . I want model validation using ajax On Wednesday, 30 July 2014 14:59:03 UTC+5:30, Dr. Tari

Re: Model Validation

2014-07-30 Thread Dr. Tarique Sani
Start here http://bit.ly/UKovlN If you get stuck with a method you choose ask further questions. Tarique On Wed, Jul 30, 2014 at 2:40 PM, Sudhir Pandey wrote: > How can I perform cakephp Model validation using ajax & shows error > message. > > I have already set the

Model Validation

2014-07-30 Thread Sudhir Pandey
How can I perform cakephp Model validation using ajax & shows error message. I have already set the error message in controller but not shown in view. $this->Candidateprofile->set($this->data); if($this->Candidateprofile->validates()) { $this->Candidateprofi

Re: Multiple Model Validation

2013-12-16 Thread Reuben
>From the controller, you can access $this->validationErrors to view validation errors from multiple models. Though from your example, if you were saving an Order, wouldn't you want to look at $this->Order->validationErrors to see all the errors associated with that save? Regards Reuben Helms

Multiple Model Validation

2013-12-16 Thread Advantage+
When doing something like this: if($this->Order->saveAssociated($this->request->data, array('validate' => 'first'))){ good stuff... } else { echo 'hello';

Model validation rule in cake1.3

2013-04-20 Thread Chris
Hi guys,... is there a way to validate rule, NOT to submit if string consist "<", "script", "javascript" etc,... here is my code: 'name' => array( 'rule' => '/^<\w+|<|script|java|javascript|>$/', 'required' => false, 'allowEmpty' => false, 'message' => 'forbidden

Re: CKEditor and model validation

2013-04-15 Thread angel reyes
Thanks it works. On Sunday, April 14, 2013 12:54:42 PM UTC-7, frederikjacques wrote: > > Hi Chris, > > I've written a blog post about this issue with sample code. > You can read it here > http://blog.the-nerd.be/2013/04/add-ckeditor-to-cakephp-with-model-validation/ > &

Re: CKEditor and model validation

2013-04-15 Thread Chris
get thru,... thanks chris On Sunday, April 14, 2013 12:54:42 PM UTC-7, frederikjacques wrote: > > Hi Chris, > > I've written a blog post about this issue with sample code. > You can read it here > http://blog.the-nerd.be/2013/04/add-ckeditor-to-cakephp-with-m

Re: CKEditor and model validation

2013-04-14 Thread frederikjacques
Hi Chris, I've written a blog post about this issue with sample code. You can read it here http://blog.the-nerd.be/2013/04/add-ckeditor-to-cakephp-with-model-validation/ Cheers, Frederik On Saturday, April 13, 2013 8:35:42 PM UTC+2, Chris wrote: > > hi frederik,... > I

Re: CKEditor and model validation

2013-04-13 Thread Chris
'5', 'class' => 'ckeditor')); ?> can you share with us please,... thanks in advance chris On Saturday, April 13, 2013 9:11:15 AM UTC-7, frederikjacques wrote: > > Hi all, > > I was wondering how you can use CKEditor and the model validation ar

CKEditor and model validation

2013-04-13 Thread frederikjacques
Hi all, I was wondering how you can use CKEditor and the model validation array. I got my textareas changed to CKEditors, but now my validation fails. If I remove a rule like non-empty everything works again, but I would rather keep my validation rules :-) Cheers, Frederik -- Like Us on

Re: Model Validation Error Message

2013-01-21 Thread Igor Padovan da Silva
put key error in input options. echo $this->Form->input('orgao_id', array('div' => false, 'class' => 'text-input small-input', 'label' => 'Orgão', 'empty' => 'Selecione', 'error' => array('wrap'=>'span','class' => 'input-notification error png_bg')) ); Em sexta-feira, 18 de janeiro de 2013 19h

Re: Model Validation Error Message

2013-01-19 Thread jodator
You can: - Add a massege by Model::invalidate function or even add a message to validation error messages field (Controller::validationErrors) - Add client side validation (there a neat jQuery validation plugin with minimal configuration On Friday, January 18, 2013 11:35:56 PM UTC

Model Validation Error Message

2013-01-18 Thread Michael Gaiser
So because of how I am dynamically creating my form inputs/save data, the standard rule validation msg isnt being displayed on the input when the save rule returns false. How do I manually trigger the msg to appear on a given input? Thanks ~Michael -- Like Us on FaceBook https://www.facebook.co

Re: Associative model validation fails, but does not report.

2012-06-07 Thread Michael Gaiser
propagating back to my view from the associated model validation (I have a feeling it was a cache thing) but the validation is ultimately failing because for some reason, the validation rule is being run twice. The first time, it works and returns true but it is then run again but the link to $this

Re: Associative model validation fails, but does not report.

2012-06-07 Thread bs28723
- > If you reply to this email, your message will be added to the > discussion below: > http://cakephp.1045679.n5.nabble.com/Associative-model-validation-fails-but-does-not-report-tp5708611.html > > > To start a new topic under Cak

Associative model validation fails, but does not report.

2012-06-06 Thread Michael Gaiser
So I have a form in my domains/add view. All the domain input fields save their data just fine when the form is submitted. The problem is that there is another field (Characters.0.character_id) that is to save its data to an hasMany associated join model (CharactersDomain). In the CharactersDomain

Re: custom model validation question

2012-06-06 Thread Michael Gaiser
ok. i figured it out. The models being saved can be accessed in the validation rule through $this->data. On Wed, Jun 6, 2012 at 10:29 AM, Michael Gaiser wrote: > I guess my question is: How do you get access to all the other > associated data that is being saved? I can set it up so I catch it > b

Re: custom model validation question

2012-06-06 Thread Michael Gaiser
I guess my question is: How do you get access to all the other associated data that is being saved? I can set it up so I catch it before the save happens, but it feels kind of hacky and does not make use of the field error message code. -- Our newest site for the community: CakePHP Video Tutorial

Re: custom model validation question

2012-06-05 Thread Michael Gaiser
ok... How would you test if other associations were submitted? The example in the docs does not really work for what I want to test against. How do I get access to all the other fields submitted to be saved? On Tue, Jun 5, 2012 at 9:44 PM, John Hardy wrote: > Write your own validation routine. >

Re: custom model validation question

2012-06-05 Thread John Hardy
Write your own validation routine. On Jun 5, 2012, at 5:45 PM, Michael Gaiser wrote: > I have a Domain Model that has 4 "has Many" relationships with 4 > different join models (Character, Clan, Covenant, Coterie). When > creating a new record, the user is presented with 4 option boxes, each > fi

custom model validation question

2012-06-05 Thread Michael Gaiser
I have a Domain Model that has 4 "has Many" relationships with 4 different join models (Character, Clan, Covenant, Coterie). When creating a new record, the user is presented with 4 option boxes, each filled with different data pertaining to the 4 associated models but defaulting to an empty option

Re: Model Validation field names

2012-04-15 Thread lowpass
You could use Cake's translation. locale/eng/LC_MESSAGES/default.po: msgid "password_control" msgstr "Confirm Password" But I notice you're already using the __() function elsewhere. If you've already got a multilingual app then this may not be the best choice (depending on your other field na

Model Validation field names

2012-04-14 Thread CyberGlitch
Sort of a unique situation but maybe not? I'm curious if it's possible to change the "field" name when being displayed in validationErrors. Something that could be set in the model would make the most sense but can't seem to find what I'm looking for. Background. Doing custom flash messages and fo

Re: Translate model validation question

2011-10-14 Thread heohni
Hi, thanks, this works for me except the problem that I get this error message: Do you know why this is happening? Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '_validationRule

Re: Translate model validation question

2011-10-13 Thread Dr. Loboto
http://book.cakephp.org/view/1230/Localization-in-CakePHP Reload invalidate() method. On 13 окт, 18:38, heohni wrote: > Hi, > > I have this in my app_model.php > public $validate = array(); > >     public function __construct($id = false, $table = null, $ds = > null) { >         parent::__constr

Translate model validation question

2011-10-13 Thread heohni
Hi, I have this in my app_model.php public $validate = array(); public function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); $this->_validationRules(); } And this way I have my model unction _validationRules() { $th

Re: Security and Model Validation Questions

2011-08-20 Thread WebbedIT
Glad my past mistakes could be of help to you :P HTH, Paul P.S. I'm going to CakeFest Manchester for all 4 days, would love to know who else is going .. a rare chance for us all to meet up! On Aug 20, 5:12 am, andrewperk wrote: > WebbedIT, you had it correct. Thanks so much. > > I fixed the pro

Re: Security and Model Validation Questions

2011-08-19 Thread andrewperk
WebbedIT, you had it correct. Thanks so much. I fixed the problem, There was never anyone gaining access to my app. It was in my paypal processing after a completed payment. I wasn't actually confirming that a user had been found before doing the update so this was creating a blank user. Here's t

Re: Security and Model Validation Questions

2011-08-19 Thread andrewperk
Also, this is not happening locally when I develop. I would think if I had a form somewhere creating blank users it should happen locally as well. This is only happening on my remote server. I don't know how to fix this. =( On Aug 19, 9:46 am, andrewperk wrote: > Hi WebbedIT, The reason I think

Re: Security and Model Validation Questions

2011-08-19 Thread andrewperk
Hi WebbedIT, The reason I think someone is having access to my db is that in my user table, I have a field called subscriber(varchar) and by default(SQL default) when a user is created this field is populated with the word NO in it. The blank user fields that are being created have the subscriber

Re: Security and Model Validation Questions

2011-08-19 Thread WebbedIT
Are you sure someone is actually gaining access to your database? If they were, I would expect them to do a lot worse than create some blank records in your user table. It is possible you have a form somewhere in your app for a model that is related to User, but are not including User.id field in

Re: Security and Model Validation Questions

2011-08-18 Thread andrewperk
Hi again, it appears that this did not fix the problem. He's still gaining database access. I've changed my core.php debug to 0. I also changed the password of my database. I've checked my server to make sure its not displaying php errors. I'm using the security component. I'm on Cake 1.3.10. I'm

Re: Security and Model Validation Questions

2011-08-13 Thread euromark
yes, with security component this is not possible. but ceeram is right about the password displayed. On 13 Aug., 01:13, andrewperk wrote: > The username and password is specific to just that database luckily. > I've changed the information. Thanks Ceeram. > > On Aug 12, 3:51 pm, Ceeram wrote: >

Re: Security and Model Validation Questions

2011-08-12 Thread andrewperk
The username and password is specific to just that database luckily. I've changed the information. Thanks Ceeram. On Aug 12, 3:51 pm, Ceeram wrote: > with debug on, and there is an error with db connection, it will show db > login credentials (this is changed in latest versions), so they probably

Re: Security and Model Validation Questions

2011-08-12 Thread Ceeram
with debug on, and there is an error with db connection, it will show db login credentials (this is changed in latest versions), so they probably accessed the db itself, is the user allowed for all hosts on the db or just local? -- Our newest site for the community: CakePHP Video Tutorials ht

Re: Security and Model Validation Questions

2011-08-12 Thread andrewperk
y didn't do any damage > > they just kind of let me know I had a bug somewhere. > > > They were somehow able to bypass my model validation and register > > themselves with a NULL username and password and marked themselves as > > a premium member which can only be don

Re: Security and Model Validation Questions

2011-08-12 Thread euromark
ction to development to do some > testing of things on the live server and forgot to change it back. I > left it like this for about a week. > > Apparently someone smart found the website. They didn't do any damage > they just kind of let me know I had a bug somewhere. > >

Security and Model Validation Questions

2011-08-12 Thread andrewperk
Apparently someone smart found the website. They didn't do any damage they just kind of let me know I had a bug somewhere. They were somehow able to bypass my model validation and register themselves with a NULL username and password and marked themselves as a premium member which can only be do

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 auth

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 are actions > > now in mode

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: 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->ModelName-

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

Model Validation Message

2010-08-04 Thread Miqdad Ali
anybody idea for this var $validate = array( 'name' => array( 'rule' => array('custom','/^[A-Z -.]{1,}$/i'), 'required' => true, '

Difference between Model Validation and manually setting error option in a form element

2010-01-28 Thread Imrael
I noticed a strange behaviour today. I tried to enter some manual validation into a form. This worked fine, except that the error message was printed out before the input element: Please select or enter a Journal [...] When I use the Model Validation, the Error Message is appended after the

Re: Localization for Model validation messages

2009-12-27 Thread euromark
i wouldnt copy it exactly 1:1 translations should never be just "Minimum length of 8 characters" then you'd need the same text for all other 999 different character lenghts better to use sprintf(__(text, true), var1, var2, ..) with %s etc On 27 Dez., 10:47, Walther wrote: > Check here:http

Re: Localization for Model validation messages

2009-12-27 Thread Walther
Check here: http://book.cakephp.org/view/133/Multiple-Rules-per-Field (at the bottom) for the recommended method of doing it. On Dec 26, 10:55 am, si-mon wrote: > Thanks John. Thanks Euromark. Really helpful... > > On Dec 25, 9:55 pm, John Andersen wrote: > > > I can't agree, as I prefer to have

Re: Localization for Model validation messages

2009-12-26 Thread si-mon
Thanks John. Thanks Euromark. Really helpful... On Dec 25, 9:55 pm, John Andersen wrote: > I can't agree, as I prefer to have the model be concerned with model > things (data, retrieval, saving, validation, etc.), and the view > concerned with presenting the data and the related error messages, >

Re: Localization for Model validation messages

2009-12-25 Thread John Andersen
I can't agree, as I prefer to have the model be concerned with model things (data, retrieval, saving, validation, etc.), and the view concerned with presenting the data and the related error messages, including the localization! Usually I only have one form in which data for a specific model is en

Re: Localization for Model validation messages

2009-12-25 Thread euromark
i dont like the form-way it is quite redundant - if you add a new rule you might forget one or two views which would not be helpful having it all together in the model is in my opinion a cleaner approach :) On 25 Dez., 12:32, John Andersen wrote: > Use the form helpers option for the input fiel

Re: Localization for Model validation messages

2009-12-25 Thread John Andersen
Use the form helpers option for the input fields! Look at: http://book.cakephp.org/view/198/options-error Thus you localize in the view - example: echo $form->input( 'email', array( 'label' => __('e-mail address',true), 'error' => array('users_email_rule' => __ ('users_email_rul

Re: Localization for Model validation messages

2009-12-24 Thread euromark
put this in your app_model.php /** * Overrides the Core invalidate function from the Model class * with the addition to use internationalization (I18n and L10n) * @param string $field Name of the table column * @param mixed $value The message or value w

Localization for Model validation messages

2009-12-24 Thread si-mon
Hi All, Is there a way to use localization for validation messages in the Model $validate array? eg: $validate = array ( 'name' => array('rule'=>'notEmpty', 'message'=>'Name is mandatory' )); I need the message 'Name is mandatory' in five different languages. In other words: How can we use func

Re: Model validation on unit testing

2009-07-23 Thread jperras
Look up the difference between the 'required' rule and the 'notempty' rule. http://book.cakephp.org/view/129/required -jperras. On Jun 7, 9:14 am, williamn wrote: > Hi all, > > I have a simple model like below > > class Department extends AppModel { > >         var $name = 'Department'; >    

Re: Model validation on unit testing

2009-07-22 Thread William Notowidagdo
Thanks. I will try it. On Wed, Jul 22, 2009 at 4:33 PM, Joe wrote: > > 'between' => array( > > 'rule' => array('between', 1, 5), > > 'message' => '1 - 5 only' > > ), > > should be (between and range) > > > 'b

Re: Model validation on unit testing

2009-07-22 Thread Joe
> 'between' => array( > 'rule' => array('between', 1, 5), > 'message' => '1 - 5 only' > ), should be (between and range) > 'between' => array( > 'rule' => array('range', 1, 5), >

Re: Model validation on unit testing

2009-07-22 Thread Joe
model/rating.php class Rating extends AppModel { var $name = 'Rating'; var $validate = array( 'score' => array( 'numeric' => array( 'rule' => 'numeric', 'message' => 'numeric score only'

Re: Model validation on unit testing

2009-07-21 Thread Joe
same here On 7月10日, 下午5時03分, williamn wrote: > Hi all, > > Did this ever happened to anyone here? :) > > On Jun 7, 8:14 pm, williamn wrote: > > > > > Hi all, > > > I have a simple model like below > > > class Department extends AppModel { > > >         var $name = 'Department'; > >         var

Re: Model validation on unit testing

2009-07-10 Thread williamn
Hi all, Did this ever happened to anyone here? :) On Jun 7, 8:14 pm, williamn wrote: > Hi all, > > I have a simple model like below > > class Department extends AppModel { > >         var $name = 'Department'; >         var $validate = array( >                 'code' => array('notempty'), >    

Model validation on unit testing

2009-06-07 Thread williamn
Hi all, I have a simple model like below class Department extends AppModel { var $name = 'Department'; var $validate = array( 'code' => array('notempty'), 'name' => array('notempty'), 'abbreviation' => array('notempty'),

Re: Using dynamic values in model validation

2008-12-25 Thread Adam Royle
Controllers talk to models, not the other way round, so you would need to call a method in your model from your controllers, passing the params as necessary. On Dec 23, 8:52 am, gearvOsh wrote: > No not that. In the models beforeValidate() is it possible for me to > do like $controller->params?

Re: Using dynamic values in model validation

2008-12-22 Thread gearvOsh
No not that. In the models beforeValidate() is it possible for me to do like $controller->params? UsersController -> User Model So in User::beforeValidate() can I get UsersControllers params, is basically what im asking? --~--~-~--~~~---~--~~ You received this mes

Re: Using dynamic values in model validation

2008-12-22 Thread Adam Royle
I don't really understand your question... are you asking if you can see what data is going to be saved from inside the beforeValidate() method? If so, look at $this->data Cheers, Adam On Dec 22, 8:20 pm, gearvOsh wrote: > Thanks, also is there a way I can get the parent controller data as

Re: Using dynamic values in model validation

2008-12-22 Thread gearvOsh
Thanks, also is there a way I can get the parent controller data as well? --~--~-~--~~~---~--~~ 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

Re: Using dynamic values in model validation

2008-12-21 Thread Adam Royle
x27;fieldName'] = array('between' => array(... etc ...)); return true; } Cheers, Adam On Dec 22, 4:57 pm, gearvOsh wrote: > Is there a way to use dynamic variables within the Model validation, > an example below. > > 'between' => array( >         'r

Using dynamic values in model validation

2008-12-21 Thread gearvOsh
Is there a way to use dynamic variables within the Model validation, an example below. 'between' => array( 'rule' => array('between', $passMin, $passMax), 'message' => 'Password must be between '. $passMin .' and &#x

Re: Explanation for model validation on parameter in conjunction with required = true [SOLVED]

2008-12-13 Thread mr_timp
Hi Adam, Awesome! Exactly the kind of feedback I was looking for. Your right I'm probably basing my design on older ways of doing things, your example is much less complicated and easier to read. Thanks for your feedback! --~--~-~--~~~---~--~~ You received this

Re: Explanation for model validation on parameter in conjunction with required = true

2008-12-13 Thread Adam Royle
Hi Mr Timp, Yes, your example looks a bit old/odd. The "correct" equivalent of : $this->User->data = $this->data; is this: $this->User->set($this->data); This will ensure $this->User->id is updated with the correct value. However, having said that, most of the code you've got seems unneeded.

Re: Explanation for model validation on parameter in conjunction with required = true

2008-12-13 Thread mr_timp
Hi There, Problem solved. $this->User->id was unset inside the controller - which is kinda weird. I have fixed it by doing the following: $this->User->id = $this->data["User"]["id"]; Does it seems odd that I should have to do that? The example of code I'm using was taken from a supposed work

Re: Explanation for model validation on parameter in conjunction with required = true

2008-12-13 Thread mr_timp
Hi again, I have managed to track back what I think the problem is but I'm having a hard time thinking this is an issue inside Cake given the number of users who are using the on parameter. If I add $this->id = [the id of my user] as the first line inside cake/libs/model/model.php in the invalidF

Explanation for model validation on parameter in conjunction with required = true

2008-12-12 Thread mr_timp
Hi, Can someone explain how the on create/update works in conjuncation with required = true in a model? Looking at the documentation on the cake web site it indicates that if you have on create set the rule should be ignored if the action is an update (and vice versa) but when required = true is

Re: All model validation failing when required => true set [SOLVED]

2008-12-12 Thread mr_timp
Typical - looks like I found the answer shortly after posting ;) Anyway hopefully this will help anyone who has a similar issue: http://cakebaker.42dh.com/2008/11/05/the-modelvalidates-trap/ http://cakebaker.42dh.com/2007/01/06/parameter-for-modelvalidates-is-now-deprecated/ I was passing $thi

All model validation failing when required => true set

2008-12-12 Thread mr_timp
Hi, There is probably something very simple that I'm doing wrong but since adding required => true to the validate array for my User model I'm having validation fail for all validation rules with this parameter in the array. An example of my validation array is below: var $validate = ar

Re: Model Validation -> 'blank' rule triggered without beeing set

2008-11-13 Thread leberle
Thanks :) @ > btw, your TRUE shouldn't be enclosed in an array, it should be " > 'required' => true ". well, i got confused by the warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash when i dont had the "required" setting in an array, so i pushed it into

Re: Model Validation -> 'blank' rule triggered without beeing set

2008-11-13 Thread Rafael Bandeira aka rafaelbandeira3
> triggered? And how can i avoid it without changing the cakecore? set the 'rule' key on $validate for each field, and specify the rule you want it to follow, when a validation scheme is set on $validate but no rule is specified, the 'blank' rule is assumed. Please refer to the cookbook for more

Model Validation -> 'blank' rule triggered without beeing set

2008-11-13 Thread leberle
Hi guys, I've a confusing problem here: my model: -- class MenuStructure extends AppModel { var $validate = array('root_struct_id' => array('required' => array (true)), 'parent_struct_id'

Re: Selective field model validation

2008-08-18 Thread francky06l
Check carefully the meaning of "required" versus "notEmpty" (or '/\S +/') in validation ("required" makes the field mandatory -- but can be empty -- every time single time you call validation, whether the field is in a form or not). Some usage of "on" => "create" might also help. hth On Aug 18,

Re: isUnique model validation 'on create' not working?

2008-08-18 Thread Zoltan
Problem turned out to be I had taken the 'id' field out of the edit.ctp file. Put it back in, and everything worked fine. Zoltan On Aug 18, 1:38 pm, haj <[EMAIL PROTECTED]> wrote: > I know I'm not answering to the question but a field that needs to be > unique generally hold the same requiremen

Re: Selective field model validation

2008-08-18 Thread AD7six
On Aug 18, 9:47 pm, David Yell <[EMAIL PROTECTED]> wrote: > This was solved in #cakephp > By using $this->Model->validates($this->data['Model']['field'] > > So big thanks to penfold_99 for sorting this for me, thanks! That reminds me of the time someone "optimized" my code by commenting out all

Re: Selective field model validation

2008-08-18 Thread David Yell
This was solved in #cakephp By using $this->Model->validates($this->data['Model']['field'] So big thanks to penfold_99 for sorting this for me, thanks! On Aug 18, 3:26 pm, David Yell <[EMAIL PROTECTED]> wrote: > Hi, > > I've been doing some work with my users model and I got to a stage > where I

Re: isUnique model validation 'on create' not working?

2008-08-18 Thread haj
I know I'm not answering to the question but a field that needs to be unique generally hold the same requirement on an edit? For the real answer, it's working here. Sorry for not helping.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Selective field model validation

2008-08-18 Thread teknoid
I would suggest to carefully read the manual, where it talks about data validation ;) On Aug 18, 10:26 am, David Yell <[EMAIL PROTECTED]> wrote: > Hi, > > I've been doing some work with my users model and I got to a stage > where I was creating a method to change a users password to avoid the > d

isUnique model validation 'on create' not working?

2008-08-18 Thread Zoltan
In my model I'm doing something like: var $validate = array( 'slug' => array('rule' => 'isUnique', 'on' => 'create', 'message' => 'This title slug has already been taken.'), 'venue_type_id' => array('numeric'),... Creating a new record works fine. Now the

Selective field model validation

2008-08-18 Thread David Yell
Hi, I've been doing some work with my users model and I got to a stage where I was creating a method to change a users password to avoid the default edit screen from having a populated password and such. Either way I ended up with a change_password method and view, this works great. On this page

Re: Use localization in model validation

2008-07-11 Thread Alessandro Daducci
Sorry, you're right! I confused my code while I rewrite it to adapt to Emilio's case. I just used the trick you cited in yout post (about __contruct(...) method). It was a very nice solution! But I still understand one point: you told that in Changeset 5818 that problem was fixed. But I still hav

Re: Use localization in model validation

2008-07-11 Thread Alessandro Daducci
Sorry, You're right! I confused my code with the one that was in your old post you cited about __contruct(...). I used that trick, it was great! But I don't understand: you told that in Changeset 5815 that problem was fixed, but I still have it in my 1.2 RC2 version. What's wrong? Sorry for my s

Re: Use localization in model validation

2008-07-10 Thread francky06l
@Allessandro, that would not work, you can't initialize model variable with a function call. @Emilio, I did post a ticket on this a while ago with a solution (as you described), it has been introduced and removed after (probably because it does not cover all needs etc..). I end up writing the inv

Re: Use localization in model validation

2008-07-10 Thread Alessandro Daducci
Hi Emilio! > I'll ilustrate the problem with an example, I want to make something > like this: > > > var $validate = array > ( > "status" => array > ( > "rule" => "numeric", > "rule" => array ("range", -1, 101)

Use localization in model validation

2008-07-10 Thread Emilio González Montaña
Hello, I'm newie, I've a problem (and a solution) for use localization in variable $validate in models. I'll ilustrate the problem with an example, I want to make something like this: var $validate = array ( "status" => array (

Re: model validation rules order ?

2008-07-07 Thread Dia
ok, thanks for the explanaition and the hint :) On 7 juil, 08:47, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey! > > The rules are indeed executed in order, but only the last validation > rule that didn't pass will be shown. If you want Cake to stop > validating if a condition isn't met, yo

Re: model validation rules order ?

2008-07-06 Thread [EMAIL PROTECTED]
Hey! The rules are indeed executed in order, but only the last validation rule that didn't pass will be shown. If you want Cake to stop validating if a condition isn't met, you can set 'last' => true Here the second rule will only be executed if the first rule passes: var $validate = array(

Re: model validation rules order ?

2008-07-06 Thread Dia
PS: using 1.2 RC2 --~--~-~--~~~---~--~~ 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 from this group, send email to [EMAIL PROTECTED] For mor

model validation rules order ?

2008-07-06 Thread Dia
Hi I noticed a strange behaviour and wanted to know if it's there's a order on executing validation rules the example : case 1 : var $validate = array( 'word' => array( array( 'required' => true,

Re: Model validation

2008-07-05 Thread Sai Krishna
name > >> > application_tools.. I tried making everything singular with exception > >> > of database table. but no luck.. Can somebody tell me where am I doing >

Model Validation Rule Builder

2008-07-04 Thread Eric
I created a new way of creating validation rules for models, which I think is kind of slick, but I don't really think the way I have it working is very "cake-like" and I need some advice on how best it should be implemented. Right now in a model I am doing the following to add my RuleBuilder add

Re: Model validation

2008-07-04 Thread Jonathan Snook
lar with exception >> > of database table. but no luck.. Can somebody tell me where am I doing >> > wrong? >> >> > On Jul 4, 11:23 am, Sai Krishna <[EMAIL

Re: Model validation

2008-07-04 Thread Sai Krishna
.. Can somebody tell me where am I doing > > wrong? > > > On Jul 4, 11:23 am, Sai Krishna <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm a newbie  to cakePHP 1.2. I had been working module in which

  1   2   >