Re: Data Validation: Checking if at least one field is populated and multiple rules not validating

2014-07-17 Thread seba
Thanks very much Stephen. I kept at it and found the solution lay in removing the 'required' and 'allowEmpty' from the 'needOne' ruleset, and adding a 'required' => false in the view. Here's the working solution for any one else with this problem: The model: public $validate = array( 'last_na

Re: Data Validation: Checking if at least one field is populated and multiple rules not validating

2014-07-15 Thread Stephen S
You can try dynamically adding or removing validation rules in your custom 'checkOne' method. http://book.cakephp.org/2.0/en/models/data-validation.html#removing-rules-from-the-set On 15 July 2014 15:44, seba wrote: > Folks, > > I'm trying to ensure at least one of two fields (last_name or ema

Data Validation: Checking if at least one field is populated and multiple rules not validating

2014-07-15 Thread seba
Folks, I'm trying to ensure at least one of two fields (last_name or email) is being populated. Each field also has multiple rules. I'm using CakePHP version 2.4.2. The problem I have at the moment, after multiple permutations of updating and/or moving around the use 'last', 'allowEmpty', 're

Data validation: Client or Server?

2013-08-18 Thread Sebastien Beausoleil
I think you should see client side validation like a way to give the user a better (and faster) experience, the server side validation is to ensure the reliability of sent data. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You recei

Re: Data validation: Client or Server?

2013-08-17 Thread Dav Mat
ite will be > accessed; what if (remote, I know) you wanted to open it up as a web > service or API? Then you'd need to load up your validation anyone. Just my > 2c. > > Jeremy Burns > Class Outfit > > http://www.classoutfit.com > > On 16 Aug 2013, at 12:32:29,

RE: Data validation: Client or Server?

2013-08-16 Thread Advantage+
> d...@movepixels.com | 709.800.0852 From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Eric Haskins Sent: Saturday, August 17, 2013 12:21 AM To: cake-php@googlegroups.com Subject: Re: Data validation: Client or Server? Dave, I agree you can over expose b

Re: Data validation: Client or Server?

2013-08-16 Thread Eric Haskins
c Haskins > *Sent:* Friday, August 16, 2013 9:29 PM > *To:* cake...@googlegroups.com > *Subject:* Re: Data validation: Client or Server? > > > > > > We always use both if not both server-side > > > > > > Eric Haskins > > High Octane Brands

RE: Data validation: Client or Server?

2013-08-16 Thread Advantage+
it exposed you validation set on the model. Stay away from live validation as such it sucks! Dave From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Eric Haskins Sent: Friday, August 16, 2013 9:29 PM To: cake-php@googlegroups.com Subject: Re: Data validation

Re: Data validation: Client or Server?

2013-08-16 Thread Eric Haskins
pply and works flawlessly (so far, wink,wink). But I've also written > some data validation with jQuery which is activated at the client side. > > Is there still a need to validate at the server if most browsers support > javascript? Do some of you leave off the server side valid

RE: Data validation: Client or Server?

2013-08-16 Thread Advantage+
ps.com [mailto:cake-php@googlegroups.com] On Behalf Of Jeremy Burns | Class Outfit Sent: Friday, August 16, 2013 10:46 AM To: cake-php@googlegroups.com Subject: Re: Data validation: Client or Server? I still view jQuery as progressive enhancement. Even if it is mostly on it can still be turned off, which

Re: Data validation: Client or Server?

2013-08-16 Thread Jeremy Burns | Class Outfit
apply and works flawlessly (so far, wink,wink). But I've also written some > data validation with jQuery which is activated at the client side. > > Is there still a need to validate at the server if most browsers support > javascript? Do some of you leave off the server side val

Data validation: Client or Server?

2013-08-16 Thread jerome
I wanted to get some opinions on this. Cake's validation structure is easy to apply and works flawlessly (so far, wink,wink). But I've also written some data validation with jQuery which is activated at the client side. Is there still a need to validate at the server if most browse

Re: Conditional Data Validation

2013-08-09 Thread ANES P.A
Dear Kemish, URL: http://www.louiemiranda.com/2010/07/15/cakephp-validate-dependent-field-select-dropdown-input-field/ Still has problem pls share your code with me. Thanks, Anes On Fri, Aug 9, 2013 at 6:50 PM, Kemish Hendershot wrote: > I need to perform conditional data validation but

Conditional Data Validation

2013-08-09 Thread Kemish Hendershot
I need to perform conditional data validation but am not sure the best way to go about it. I have performed more complex validation, like verifying passwords match with a new account registration, but I need to perform validation on fields that are dependent on another field. For example, if

Data validation in multilingual website (with i18n)

2012-01-23 Thread Anna P
Hello. I'm building an multilingual website in CakePHP 2.0.5 with the use of I18n. My question is: how can I define (in model class) validation rules, so they apply to specified language version (locale)? I have an i18n table, "languages" table (id,code), "subpages" table (id,created) While addi

Re: Data Validation using Model - field_one OR field_two OR field_three

2011-07-13 Thread Sanfly
y( >                                 'rule' => 'hasOnePhone', >                                 'message' => 'You must enter at least one > phone number.', >                                 'last' => true >                    

Re: Data Validation using Model - field_one OR field_two OR field_three

2011-07-13 Thread Jeremy Burns | Class Outfit
> true ), ... ), ...and so on. This actually checks across three models in the data array. You can take out the [$addressType] foreach loop and simply hard code the name of your model. Jeremy Burns Class Outfit http://www.classoutfit.com On 13

Data Validation using Model - field_one OR field_two OR field_three

2011-07-13 Thread Sanfly
Hi Im doing some data validation from a form using my model. I have a form with phone numbers added: phone_home, phone_mobile, phone_work With my model, I want to validate that at least one of the three is filled, but doesnt have to be all three. Is there any way to do that? -- Our newest

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

2010-09-08 Thread Joshua Muheim
Another question: is there a way to display the error message not in one of the checked fields? Because it applies to all the fields (phone_home AND phone_work AND phone_cell), not just one (phone_home in the posted example)... Thanks :-) On Wed, Sep 8, 2010 at 9:16 AM, Joshua Muheim wrote: > Tha

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 Tue, Sep 7, 2010 at 3:12 PM, Jeremy

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: > > The validation rule is: > > > 'phone_hom

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', > 'message' => 'You must enter at least one phone number.', > 'last' => true > ) > ), >

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', 'message' => 'You must enter at least one phone number.',

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? Thanks, Josh

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 > validation but is way easier t

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. > apparently, th

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 ($this->Model-

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: Data validation rule (between) never returns true

2010-03-25 Thread WebbedIT
For reference here are the custom validation rules I use: function __validateConfirmPassword($field) { $valid = false; if ($this->data['User']['password'] == Security::hash(Configure::read('Security.salt'). $field['password_confirm']) { $valid = true; } return $valid; } function __val

Re: Data validation rule (between) never returns true

2010-03-25 Thread WebbedIT
Here are my user custom validation methods function __validateConfirmPassword($field) { $valid = false; if ($this->data['User']['password'] == Security::hash(Configure::read('Security.salt') . $field['password_confirm']) { $valid = true; } return $valid; } function __validatePasswordL

Re: Data validation rule (between) never returns true

2010-03-24 Thread timstermatic
@Dr. Loboto Thanks for the answer. That does make sense to me. @WebbedIT It also makes sense that providing they match I can take the confirm_password as the test for password length. Cheers for the help. On Mar 24, 9:13 am, WebbedIT wrote: > most auth setups also have a password_confirm fi

Re: Data validation rule (between) never returns true

2010-03-24 Thread WebbedIT
most auth setups also have a password_confirm field and use that to validate password length etc. 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"

Re: Data validation rule (between) never returns true

2010-03-23 Thread Dr. Loboto
If you use Auth password field is already hashed so it's length more then 15 symbols. On Mar 24, 1:39 am, timstermatic wrote: > Hi all, > > Here is part of a validate array I have in a model: > >               'username' => array( >                     > 'loginRule-1'=>array('rule'=>'alphaNumeri

Data validation rule (between) never returns true

2010-03-23 Thread timstermatic
Hi all, Here is part of a validate array I have in a model: 'username' => array( 'loginRule-1'=>array('rule'=>'alphaNumeric','message'=>'Username must be alphanumeric - no spaces.' ), 'loginRule-2'=>array('rule' => array('between',5,15),'mes

Re: Data Validation not working

2010-03-18 Thread Henrique Machado
Linux is case sensitive, windows isn't At Linux, You can have at the same directory the files: inventory.php and Inventory.php Henrique Machado TI Expert 2010/3/19 SeeVik > Hello all > > Thanks for guiding me out of this problem. > > @ Dr. Loboto - Yes that was the problem. The model filename

Re: Data Validation not working

2010-03-18 Thread SeeVik
Hello all Thanks for guiding me out of this problem. @ Dr. Loboto - Yes that was the problem. The model filename was Inventory.php. As soon as I changed it to inventory.php, it worked like a charm. Although why it worked on Windows local server and not on Linux web server is what I don't get. Any

Re: Data Validation not working

2010-03-17 Thread logout
I also vote for problems in the path/filename. Be sure exactly what file you edit (the model) - I had exactly the same problem - it turned out that i was editing a wrong file. When I opened the correct one, all worked fine. Your file for the model is inventory.php in the app/models, right? Check

Re: Data Validation not working

2010-03-17 Thread WebbedIT
@sooraj: If using the form helper it automatically includes validation errors unless your suppress it by setting error=>false 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: Data Validation not working

2010-03-16 Thread sooraj francis
actually you havent set the display option to show error in your view file isFieldError('Inventory.make')) e($form->error('Inventory.make', null, array('class' => 'message'))); hope this solves your problem Check out the new CakePHP Questions site http://cakeqs.org and help others with their C

Re: Data Validation not working

2010-03-15 Thread Dr. Loboto
sure your server > > table structure and constraints are the same of your local machine. > > > On 15 mar, 01:20, SeeVik wrote: > > > > Hello all > > > > I am using CakePHP 1.2 and I am trying to implement a simple form data > > > validation. The t

Re: Data Validation not working

2010-03-15 Thread SeeVik
Mordente wrote: > Probably there is an error at database level. Make sure your server > table structure and constraints are the same of your local machine. > > On 15 mar, 01:20, SeeVik wrote: > > > > > Hello all > > > I am using CakePHP 1.2 and I am trying to impleme

Re: Data Validation not working

2010-03-15 Thread Lucca Mordente
Probably there is an error at database level. Make sure your server table structure and constraints are the same of your local machine. On 15 mar, 01:20, SeeVik wrote: > Hello all > > I am using CakePHP 1.2 and I am trying to implement a simple form data > validation. The thing is t

Data Validation not working

2010-03-14 Thread SeeVik
Hello all I am using CakePHP 1.2 and I am trying to implement a simple form data validation. The thing is that the data validation works on my local machine but it doesn't work on my rental server (Linux FreeBSD server). Here's my model array( 'rule

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread euromark
ed. So what's the new way of doing > > > it? > > > > Thanks and Regards > > > ShiVik > > > > On Mar 11, 8:32 pm, euromark wrote: > > > > > always use $form->input() > > > > this will make a lot for u automatically >

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread SeeVik
at > > in cakephp 1.2 it has been deprecated. So what's the new way of doing > > it? > > > Thanks and Regards > > ShiVik > > > On Mar 11, 8:32 pm, euromark wrote: > > > > always use $form->input() > > > this will make a lot for u autom

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread nurvzy
lly > > > On 11 Mrz., 11:19, SeeVik wrote: > > > > Hello all > > > > I am using cakephp 1.2 and I am having problem in displaying the error > > > messages for the data validation of a form. I created the form like > > > this > > > &g

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread SeeVik
e: > > > > > Hello all > > > I am using cakephp 1.2 and I am having problem in displaying the error > > messages for the data validation of a form. I created the form like > > this > > > create( 'Posts', array( 'action' => '

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread euromark
always use $form->input() this will make a lot for u automatically On 11 Mrz., 11:19, SeeVik wrote: > Hello all > > I am using cakephp 1.2 and I am having problem in displaying the error > messages for the data validation of a form. I created the form like > this > >

Data Validation Errors not displaying!!!

2010-03-11 Thread SeeVik
Hello all I am using cakephp 1.2 and I am having problem in displaying the error messages for the data validation of a form. I created the form like this create( 'Posts', array( 'action' => 'index' ) ); ?> text( 'text' ); ?> text( 'val

Re: Data validation doesn't work when on live server

2010-02-18 Thread Atti
3) Write your own custom validation rules for any built-in rules that > use multibyte flags in the regular expressions. > > There aren't really any other options. > -jperras > > On Feb 17, 3:43 pm, Atti wrote: > > > Hi all, > > Just a quick question, I mana

Re: Data validation doesn't work when on live server

2010-02-18 Thread Atti
$saved = false; $message = "There was a problem when saving your details to the database, Please try again"; }

Re: Data validation doesn't work when on live server

2010-02-18 Thread jperras
Hi all, > Just a quick question, I managed to get my data validation working > perfectly on my local apache (XAMPP) web server, but as soon as I > uploaded the site to the internet the validation flag seems to be > always true, ie, there is not validation going on, so it seems. What >

Re: Data validation doesn't work when on live server

2010-02-17 Thread Jamal Aziz
Can you post your model and your controller action? On Feb 18, 3:43 am, Atti wrote: > Hi all, > Just a quick question, I managed to get my data validation working > perfectly on my local apache (XAMPP) web server, but as soon as I > uploaded the site to the internet the validation f

Data validation doesn't work when on live server

2010-02-17 Thread Atti
Hi all, Just a quick question, I managed to get my data validation working perfectly on my local apache (XAMPP) web server, but as soon as I uploaded the site to the internet the validation flag seems to be always true, ie, there is not validation going on, so it seems. What settings on my live

Re: Data Validation

2009-08-24 Thread DavidH
Have you tried array('rule' => 'notEmpty', 'message' => '.') I.e. don't put the notEmpty into an array. This is the format in the CookBook http://book.cakephp.org/view/338/Data-Validation David On Aug 24, 8:28 am, Juan Jose Marquez wro

Re: Data Validation

2009-08-24 Thread Juan Jose Marquez
I have a small problem with the validation of some fields in a model The particular problem is that the system validates the data if the model but I painted the error messages in sight and it is not possible and have tried some things but nothing and I'm desperate. This is the code I have

Re: Data Validation - What's wrong?

2009-07-17 Thread gjofum
Great. It works. Thank you On Jul 17, 4:03 pm, "rich...@home" wrote: > Should be: > >         var $validate = array( >                 "module_data" => array( >                         "module_dataRule1" => array( >                                 "rule" => "notEmpty", >                        

Re: Data Validation - What's wrong?

2009-07-17 Thread rich...@home
Should be: var $validate = array( "module_data" => array( "module_dataRule1" => array( "rule" => "notEmpty", "message" => "empty", "required" => true

Re: Data Validation - What's wrong?

2009-07-17 Thread gjofum
I am setting data a then validate them. $this->Module->set($this->data); if($this->Module->validates()) print "YES"; else print "NO"; But I have one more problem. I get 2 errors with just validate rule below. Warning (2):

Re: Data Validation - What's wrong?

2009-07-17 Thread gjofum
It doesn't help. On Jul 17, 9:58 am, joshua wrote: > Mine: > > > > > 'email' => array( > > 'noEmpty' => array( > > 'rule' => 'email', > > 'allowEmpty' => false, > > 'message' => 'Email can\'t be null' > > ), > > ), > > > > On Fri, Jul 17, 2009 at 3:55 PM, gjofum wrote: > > > I add notEmpty and

Re: Data Validation - What's wrong?

2009-07-17 Thread Miles J
Are you setting the data before you validate it, or are you juts calling save()? $this->Model->set($this->data); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to c

Re: Data Validation - What's wrong?

2009-07-17 Thread joshua
Mine: > > 'email' => array( 'noEmpty' => array( 'rule' => 'email', 'allowEmpty' => false, 'message' => 'Email can\'t be null' ), ), On Fri, Jul 17, 2009 at 3:55 PM, gjofum wrote: > > I add notEmpty and it still doesn't work. > >var $validate = array( >"module_data"

Re: Data Validation - What's wrong?

2009-07-17 Thread gjofum
I add notEmpty and it still doesn't work. var $validate = array( "module_data" => array( "module_dataRule1" => array( "rule" => "notEmpty", "message" => "empty"

Re: Data Validation - What's wrong?

2009-07-15 Thread Miles J
You need the "notEmpty" rule. --~--~-~--~~~---~--~~ 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 cake-php+uns

Data Validation - What's wrong?

2009-07-15 Thread gjofum
I have this validate in Model: var $validate = array( "module_data" => array( "module_dataRule1" => array( "rule" => array("minLength", 5), "message" => "min" ),

Data validation: date validation doesn't work

2009-05-26 Thread jbarbede
Hi, I have a problem to obtain translated error messages when I validate dates. I have the following: - a model "Member" with the following validation rules (I use the Multivalidatable behavior) : public $validationSets = array( 'signUp' => array( 'gender'

Re: Data validation in a different controller

2009-05-25 Thread brian
Why not just create a route to point these links to the UsersController? Router::connect( '/signup/:user_type', array('controller' => 'users', 'action' => 'signup'), array( 'pass' => array('user_type'), 'user_type' => '[-_A-Za-z]+' )

Data validation in a different controller

2009-05-25 Thread Bob Mattax
I'm not sure of the best path here. Here's what I'm doing right now: I have a user table, and I have a couple different types of users. I figured I would create a signup controller, and have it *use* the User model. When I create my form in the signup/typeA view, I still make it on the user Mod

Data Validation message

2009-05-14 Thread Singleman
I can't use special characters in Spanish in data validation messages.Can somebody give me a solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send em

Re: Data validation always return true

2009-04-09 Thread brian
set() is called from within save() before validation. If you need to call validates() yourself, you must first set the data. http://book.cakephp.org/view/410/Validating-Data-from-the-Controller http://api.cakephp.org/view_source/model/#line-1094 On Thu, Apr 9, 2009 at 10:05 AM, Rhee wrote: > >

Re: Data validation always return true

2009-04-09 Thread Rhee
Maybe I am just too idiot to understand this. I know what $this->Model->set() do. But I used for adding a new data set in database. Also, it has no ID / primary key yet, by the time i called set() method. So what did set() do, so that validate() can be called properly after that? On Apr 9, 3:52 p

Re: Data validation always return true

2009-04-09 Thread brian
On Thu, Apr 9, 2009 at 8:06 AM, Rhee wrote: > > Next question, why is it now working? What did $this->Model->set() do? > Can you gimme short explanation? > It sets the Primary Key for the model and $Model->data values. http://api.cakephp.org/class/model#method-Modelset --~--~-~--~~

Re: Data validation always return true

2009-04-09 Thread Rhee
; > > $this->User->validates($this->data); // always return true > > > $this->User->save($this->data); // always return true, and try to save > > > You say it always returns true, but are you testing that in an if block? > > > On Wed, Apr 8, 200

Re: Data validation always return true

2009-04-09 Thread Rhee
> $this->User->validates($this->data); // always return true > > $this->User->save($this->data); // always return true, and try to save > > You say it always returns true, but are you testing that in an if block? > > On Wed, Apr 8, 2009 at 9:59 AM, Rhee wrote: &

Re: Data validation always return true

2009-04-09 Thread logout
41 pm, brian wrote: > > $this->User->validates($this->data); // always return true > > $this->User->save($this->data); // always return true, and try to save > > You say it always returns true, but are you testing that in an if block? > > > > On Wed, Apr 8,

Re: Data validation always return true

2009-04-08 Thread brian
> $this->User->validates($this->data); // always return true > $this->User->save($this->data); // always return true, and try to save You say it always returns true, but are you testing that in an if block? On Wed, Apr 8, 2009 at 9:59 AM, Rhee wrote: > > Hi, >

Data validation always return true

2009-04-08 Thread Rhee
Hi, the data validation in my User Model always return true. Can anybody tell me why? In Model: var $validate = array ( 'login' => array ( 'notempty' => array ( 'rule'

Re: action parameters lost after data validation

2009-03-28 Thread JamesF
this should have been more obvious but echo $form->input('id', array("type" => "hidden","value" => $this->data ['Model']['id'])); solution made sure my edit form stayed an edit form and didn't lose it's parameters On Mar 27, 5:20 pm, JamesF wrote: > i am having the same problem withvalidationm

Re: action parameters lost after data validation

2009-03-27 Thread JamesF
i am having the same problem with validation making me lose my action parameters. still trying to figure out best way to pass back action parameter after failed validation. On Mar 18, 12:08 pm, koala kid wrote: > Thanks for your reply. > > Myvalidationhas become a little more complicated since

Re: data validation problem with multiple parameters

2009-03-25 Thread dubiousandrew
> Just a guess, but are you passing the auto-generated password to the > view when validation fails, so that it can be used in your form's > action attribute when re-POSTing another attempt at a new password? I don't think so. I am not doing anything. I am new to cakePHP. How do I do that? he

Re: data validation problem with multiple parameters

2009-03-25 Thread mscdex
On Mar 25, 3:41 pm, dubiousandrew wrote: > If I enter an invalid password on the form, then it does validate it > correctly and displays the error message but the new address becomes: > example.com/user/resetPassword/45 > and it truncates the password parameter and then it no longer > functions l

data validation problem with multiple parameters

2009-03-25 Thread dubiousandrew
I have an edit form that takes in two parameters, an id of the user and user password. It is designed for the first time log in so the user is forced to create a password after following a link (that contains the automatically generated password and their id). For example: example.com/user/res

Re: action parameters lost after data validation

2009-03-18 Thread koala kid
Thanks for your reply. My validation has become a little more complicated since yesterday as I am trying to validate 1 field but that field belongs to related model. In that case where should I perform the validation and how would I pass the ID back most effectively. On Mar 17, 8:50 pm, brian

Re: action parameters lost after data validation

2009-03-17 Thread brian
On Tue, Mar 17, 2009 at 4:12 PM, koala kid wrote: > > Hi, > > I am fairly new to cake and I'm making some fixes for a client on a > CMS tool someone developed for them using cake. I am trying to add a > custom validation rule on one of the forms but if it fails the ID > parameter in the URL is be

action parameters lost after data validation

2009-03-17 Thread koala kid
Hi, I am fairly new to cake and I'm making some fixes for a client on a CMS tool someone developed for them using cake. I am trying to add a custom validation rule on one of the forms but if it fails the ID parameter in the URL is being lost and the edit fails to update. Do I have to explicitly

Re: Data validation doesn't work

2009-01-09 Thread josnidhin
Finally its working now Thanks guys for all the help.. I just changes the 'user' in the form create to 'User' and now everythings working fine. On Jan 9, 12:01 pm, josnidhin wrote: > I tried this still not working..If I use scaffolding to test > everything works fine validation errors shows up.

Re: Data validation doesn't work

2009-01-08 Thread josnidhin
I tried this still not working..If I use scaffolding to test everything works fine validation errors shows up. When I use my view then the problem arises. On Jan 8, 2:29 pm, Nature Lover wrote: > Hi! > > try by mentioning also the model name while outputting errors, so the > view code will becom

Re: Data validation doesn't work

2009-01-07 Thread gearvOsh
See what happens when you remove these "required" => true,"allowEmpty"=>false. --~--~-~--~~~---~--~~ 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 unsubsc

Re: Data validation doesn't work

2009-01-07 Thread Nature Lover
Hi! try by mentioning also the model name while outputting errors, so the view code will become: create('user', array('action' => 'signup'));?> Signup input('User.users_name',array ("label"=>"Name:")); echo $form->error('User.users_name'); echo $

Re: Data validation doesn't work

2009-01-07 Thread josnidhin
create('user', array('action' => 'signup'));?> Signup input('users_name',array("label"=>"Name:")); echo $form->error('users_name'); echo $form->input('users_email',array("label"=>"Email:")); echo $form->error('users_email');

Re: Data validation doesn't work

2009-01-07 Thread gearvOsh
Heres an article I wrote on displaying for errors an alternative way, hopefully it helps. http://www.milesj.me/blog/read/10/displaying-form-errors-as-a-list-in-cakephp/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Data validation doesn't work

2009-01-07 Thread Abrar
On Jan 7, 10:12 am, Nature Lover wrote: > Hi, > > @Lucas => > For compulsory fields in a form the validation in model will be like: > >    var $validate = array( >                 'field_name' => array( >                                 'notEmpty' => array( >                                    

Re: Data validation doesn't work

2009-01-06 Thread Nature Lover
Hi, @Lucas => For compulsory fields in a form the validation in model will be like: var $validate = array( 'field_name' => array( 'notEmpty' => array( 'rule' => 'notEmpty',

Re: Data validation doesn't work

2009-01-06 Thread josnidhin
Hi, I am also experiencing the same problem. I dont know how to get the messages to show in the view when the validation fails. On Jan 4, 12:31 am, Lucas wrote: > Hi gearvOsh, > > Unfortunately nothing happens again :( > I tryed with both options (required = true and notEmpty rule) and > nothing

Re: Data validation doesn't work

2009-01-03 Thread Lucas
Hi gearvOsh, Unfortunately nothing happens again :( I tryed with both options (required = true and notEmpty rule) and nothing happens. More tips? Thanks! On 29 dez 2008, 23:24, gearvOsh wrote: > You either need to have: > > required = true > > Or use the notEmpty rule. > > http://book.cakephp

Re: Data validation doesn't work

2009-01-03 Thread Lucas
Hi gearvOsh, Unfortunately nothing happens again :( I tryed with both options (required = true and notEmpty rule) and nothing happens. More tips? Thanks! On 29 dez 2008, 23:24, gearvOsh wrote: > You either need to have: > > required = true > > Or use the notEmpty rule. > > http://book.cakephp

Re: Data validation doesn't work

2008-12-29 Thread gearvOsh
You either need to have: required = true Or use the notEmpty rule. http://book.cakephp.org/view/127/One-Rule-Per-Field http://book.cakephp.org/view/740/notEmpty --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

Data validation doesn't work

2008-12-29 Thread Lucas
Hi guys, I'm trying to use data validation on my model but I don't find where is my error. When I leave a form field empty, nothing happens (no message erros). But when fill all fields, all data is saved to database. Any skilled guy could help me? Below are some pieces of my code. I

Re: data validation for optional fields

2008-12-18 Thread Markus
Hi Grigri, your code seems work as i what i wanted it to do. thanks a lot! On Dec 16, 4:07 pm, grigri wrote: > It just so happens I was playing around with some code for exactly > this purpose. I stress that the code is proof-of-concept, and > definitely needs work and testing before being read

  1   2   >