Table's save() fails, where to get the error message? (other than validation errors)

2015-09-14 Thread Ernesto Borio
I can't find in the documentation how to collect error messages (other than validation errors) for when a table's save() or delete() fail, how is it done? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received th

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread José Lorenzo
Glad it worked :) On Wednesday, July 30, 2014 3:35:21 PM UTC+2, Jipson Thomas wrote: > > Hi Jose Lorenzo, > Thank you very much. Now it is working perfectly. > Regards, > Jipson > > On Wednesday, 30 July 2014 14:31:30 UTC+1, José Lorenzo wrote: >> >> Ok, you problem is that you are calling create(

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread Jipson Thomas
Hi Jose Lorenzo, Thank you very much. Now it is working perfectly. Regards, Jipson On Wednesday, 30 July 2014 14:31:30 UTC+1, José Lorenzo wrote: > > Ok, you problem is that you are calling create() without the entity, You > should get that fixed by doing: > > Form->create($package) ?> > > On Wed

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread José Lorenzo
Ok, you problem is that you are calling create() without the entity, You should get that fixed by doing: Form->create($package) ?> On Wednesday, July 30, 2014 3:29:33 PM UTC+2, Jipson Thomas wrote: > > Hi Jose Lorenzo, > Thank you for the reply. Please find the below code > > *CTP* > == >

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread Jipson Thomas
Hi Jose Lorenzo, Thank you for the reply. Please find the below code *CTP* == Flash->render('auth') ?> Form->create() ?> Form->input('name', ['label' => 'Package Name']); ?> Form->input('annual_price', ['label' => 'Price / Year','type' => 'decimal']); ?>

Re: Display Form Validation Errors CakePHP 3

2014-07-30 Thread José Lorenzo
There does not seem to be any Form->create() call in that code you pasted. Can you share the full code? On Wednesday, July 30, 2014 3:20:54 PM UTC+2, Jipson Thomas wrote: > > Hi , > On my package creation form I am using cakephp validation. The validation > is working perfectly. Unfortunately th

Display Form Validation Errors CakePHP 3

2014-07-30 Thread Jipson Thomas
Hi , On my package creation form I am using cakephp validation. The validation is working perfectly. Unfortunately the validation error messages are not displaying on my form. Would you please help me on this? The code I am using is as follows. Please advise me what I am missing here. *My Table

FormHelper does not show validation errors

2014-02-24 Thread wilderland
Hi I'm not sure if someone has this problem, but I need your help and maybe a push in the right direction. I have a record, with a list of assoziated records, like you have, when you bind a model with hasMany, an example I attached to this post. With the FormHelper I create the required inp

Re: Not seeing validation errors with saveAll

2013-02-27 Thread Benjamin Allison
Anyone? Are specific validation errors for a bunch of records even possible? > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group

Not seeing validation errors with saveAll

2013-02-24 Thread Benjamin Allison
I have a list of User records that I'm saving at one time (the form is populated from an uploaded CSV). Everything seems to be working fine, and my validation rules are being honoured, but one thing that's eluding me are the specific validation error messages. I get the general validation erro

How to pass HABTM validation errors to FormHelper?

2012-11-01 Thread Nvp
Hi! I read many topics about HABTM validation in Cake but I can't figure out how to solve my problem. I have my main model – Restaurants, it has many HABTM relations to additional models. Now I'm building admin area, and I'm working with new controller in which I have public $uses = array(

Re: Validation errors not working properly

2012-05-14 Thread rahaji...@bankofbaku.com
Sorry, my bad, initially I changed all occurrences of the tutorial's User to Admin, then I changed my mind and reverted back to User, but missed this echo $this->Form->create('Admin'); After changing to echo $this->Form->create('User'); everything works. Don't do this at home :) -- Our newest

Validation errors not working properly

2012-05-14 Thread rahaji...@bankofbaku.com
This stuff is mostly taken from http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html Here's the model: class User extends UserModel { public $name = 'User'; public $validate = array( 'username' => array( 'rule1' => array(

Re: RE: CakePHP Form Validation Errors -- no luck???

2011-07-23 Thread KingInky
Hey, thank you! You were completely right. I'm feeling a little dumb right now :] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsu

Re: RE: CakePHP Form Validation Errors -- no luck???

2011-07-23 Thread Tilen Majerle
i think, filename should be user.php not user_model.php :) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/7/23 KingInky > I have had no luck figuring this out. Still seeking answers. Thank you all. > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.

Re: RE: CakePHP Form Validation Errors -- no luck???

2011-07-23 Thread KingInky
I have had no luck figuring this out. Still seeking answers. Thank you all. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe

Re: RE: CakePHP Form Validation Errors -- no luck???

2011-07-22 Thread KingInky
Sure. The model (user_model.php): http://pastebin.com/RdaEfnCn The controller (users_controller.php): http://pastebin.com/4pfbWZKE The view (register.ctp): http://pastebin.com/aTjTya6z Thanks again for your help. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.o

RE: CakePHP Form Validation Errors -- no luck???

2011-07-22 Thread Meroe Kush
Please pastebin your model, view, and controller. -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of KingInky Sent: Friday, July 22, 2011 6:42 PM To: CakePHP Subject: CakePHP Form Validation Errors -- no luck??? Hello, I'm a Ca

CakePHP Form Validation Errors -- no luck???

2011-07-22 Thread KingInky
(though I honestly don't think they are), but not being displayed. I'd like to try and print out (using pre()) the array that holds the validation errors, but I have no idea where that is located. Other than that, I'm open to further suggestions. Please help me, because this is VERY t

Re: Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread stas kim
--Original Message- > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf > Of jackgoh > Sent: Monday, April 18, 2011 3:23 PM > To: CakePHP > Subject: Validation errors only working in Add form, but not in Edit form. > > Hi, > > > The validati

RE: Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread Krissy Masters
:23 PM To: CakePHP Subject: Validation errors only working in Add form, but not in Edit form. Hi, The validation message is working in Add Form, but not in the Edit Form, can anyone help me? Part of my code in the controller: function edit($id = null) { $th

Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread jackgoh
Hi, The validation message is working in Add Form, but not in the Edit Form, can anyone help me? Part of my code in the controller: function edit($id = null) { $this->Post->id = $id; $sectors = $this->Post->Sector->find('list', array(

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? Check out the new CakePHP Questio

Re: Form validation errors

2010-09-18 Thread Dr. Loboto
orks as expected. Very bizarre though, considering I started with an > >>>> empty cache and have cleared it many times during this debug process. > > >>>> Jeremy Burns > >>>> Class Outfit > > >>>> jeremybu...@classoutfit.com > >&

Re: Form validation errors

2010-09-17 Thread Jeremy Burns | Class Outfit
om >> >>>> On 17 Sep 2010, at 06:51, Jeremy Burns | Class Outfit wrote: >> >>>>> Thanks. Here's my findings from the test site. >> >>>>> get_class($this->Order->OrderItem->OrderAddress) returns 'OrderAddress', &

Re: Form validation errors

2010-09-17 Thread Dr. Loboto
t; >>> Thanks. Here's my findings from the test site. > > >>> get_class($this->Order->OrderItem->OrderAddress) returns 'OrderAddress', > >>> so the model is loaded. > > >>> I have littered debug statements througho

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
indings from the test site. >>> >>> get_class($this->Order->OrderItem->OrderAddress) returns 'OrderAddress', so >>> the model is loaded. >>> >>> I have littered debug statements throughout and the code is not erroring >>> b

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
s 'OrderAddress', so >> the model is loaded. >> >> I have littered debug statements throughout and the code is not erroring >> before or after the saves; the saves are happening and failing, producing >> validation errors. >> >> I have creat

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 such errors ha

Re: Form validation errors

2010-09-16 Thread Jeremy Burns | Class Outfit
Nope, not correct. All models named correctly - and don't forget exactly this same code works on my Mac. If your theory was right then I'd be getting all sorts of errors and the forms wouldn't pull any data at all. In my case, $this->validationErrors is empty. Jeremy Burns Class Outfit jeremyb

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 the right places. I ha

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 messages - I am leavin

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: Validation errors not shown in a form

2010-07-30 Thread Norman Paniagua
Can you add a filter in your gmail account I add the filter for the sender ( cake-php@googlegroups.com) and all the mails that I receive from this email have the gmail label cakephp. Try it, its very helpful --- Norman Paniagua 2010/7/29 John > Hi Guys, sorry for the wrong topic, but i'm new h

Re: Validation errors not shown in a form

2010-07-30 Thread John
Hi Guys, sorry for the wrong topic, but i'm new here. Just a tip for the group... would be great if in the subject of the emails, a tag [cakePHP] was inserted, will be easy to read the new posts... Thanks for let me join here, hope i can help/be helped Have a nice day On Jul 30, 2010, at 12:08

Re: Validation errors not shown in a form

2010-07-30 Thread Roland Pish
uy's added code and inputs. As a test, I also removed what he did and the same thing happened, $this->Themodel->validationErrors contains the validation errors, but the form is not showing those errors anymore. It's a long long code, so I'll try to paste it in a bin and let you

Re: Validation errors not shown in a form

2010-07-30 Thread Marco
Are you sure you are using the $form->input for all the fields and $form->create? On Jul 30, 2:19 am, Norman Paniagua wrote: > Can you show your code? > --- > > Norman Paniagua > > 2010/7/29 Roland Pish > > > > > Hi. > > > Suddenly a form stopped showing the error messages with the > class="err

Re: Validation errors not shown in a form

2010-07-29 Thread Norman Paniagua
Can you show your code? --- Norman Paniagua 2010/7/29 Roland Pish > Hi. > > Suddenly a form stopped showing the error messages with the class="error-message"> beside input fields with validation. > When a validation error occurs. If I debug($this->Themodel- > >validationErrors) it shows me th

Validation errors not shown in a form

2010-07-29 Thread Roland Pish
Hi. Suddenly a form stopped showing the error messages with the beside input fields with validation. When a validation error occurs. If I debug($this->Themodel- >validationErrors) it shows me the errors but there is no anymore. What could be wrong? I don't remember changing anything in cake's

Re: validation errors

2010-06-24 Thread Melanie Sommer
Hello Mark, thank you for your detailled explanation. It works :-) Melanie 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 thi

Re: validation errors

2010-06-21 Thread euromark
al1 && $val2) { // OK } else { ... } > > cake automatically passes the errors to the view > the field list part is optional > > note: the set part is very important in this case (thats what you > missed) > > On 20 Jun., 09:33, Melanie Sommer > wrote: > > > &g

Re: validation errors

2010-06-20 Thread euromark
List'=>$val2List); if ($val1 && $val2) { // OK } else { ... } cake automatically passes the errors to the view the field list part is optional note: the set part is very important in this case (thats what you missed) On 20 Jun., 09:33, Melanie Sommer wrote: > > Because

Re: validation errors

2010-06-20 Thread Melanie Sommer
> Because Cake do not save if validation failed and pass validation > errors to view automatically. Form helper render these errors when use > $from->input() method. Yes it does and it works beautifully - but not for input fields that do not belong of the current model. If my Mod

Re: validation errors

2010-06-19 Thread Dr. Loboto
Ordinary all you need is: if ($this->Model->save($this->data)) { // success code } else { // failure code } Because Cake do not save if validation failed and pass validation errors to view automatically. Form helper render these errors when use $from->input() method. On Jun

validation errors

2010-06-19 Thread Melanie Sommer
... } }else{ $errors = $this->Lamp->invalidFields(); } In case of validation errors, is there a clever way to get the $errors array to the view? I think cake stores the validation errors of the current model in an array, which seems to be somehow associated with $form->tagIsInvalid(

Re: Validation errors

2010-05-23 Thread John Andersen
I never uses other than $form->input() myself, so never saw your issue. Although I do use the "type" option in order to ensure a correct field type - not relying on the automagic of the $form->input method :) About now it would be good to hear something from one of the CakePHP experts, so hopefull

Re: Validation errors

2010-05-23 Thread Ed Propsner
@John You're right, I went back and looked and I was indeed using $form->input() on the earlier forms. I understand that $form->input has a bit of "automagic" that comes along with it but I honestly never would have never given a second thought that $form->select() wouldn't be so concerned with va

Re: Validation errors

2010-05-23 Thread John Andersen
Just for my own curiosity, I tried to implement your setup, and it is correct, the select will be validated, but the error message will not be displayed. The reason may be that you are using: $form->select('ProfileAttribute.gender', array('M' => 'Male', 'F' => 'Female'), false, array('empty' => '

Re: Validation errors

2010-05-23 Thread Muataz aziz
eld_name', > > null, > > array( > > 'class' => 'failure') > > )); > > } > > > > What if you have a form with say 20 fields that need to be valida

Re: Validation errors

2010-05-22 Thread Ed Propsner
lly but edited as I went along. >>>> One of the tests was with a freshly baked model and controller but the >>>> view was not. >>>> The view in that case only consisted of a form, one field, and a submit >>>> button ... it still didn't work. &g

Re: Validation errors

2010-05-22 Thread Filipe Teles Rodrigues
gt;>> button ... it still didn't work. >>> >>> I'm not quite sure what got changed or altered but I've been through 4 >>> more forms since and with every >>> one of them I had to manually display the validation errors. >>> >>> I

Re: Validation errors

2010-05-22 Thread Ed Propsner
form, one field, and a submit >> button ... it still didn't work. >> >> I'm not quite sure what got changed or altered but I've been through 4 >> more forms since and with every >> one of them I had to manually display the validation errors. >> >

Re: Validation errors

2010-05-22 Thread Filipe Teles Rodrigues
only consisted of a form, one field, and a submit > button ... it still didn't work. > > I'm not quite sure what got changed or altered but I've been through 4 more > forms since and with every > one of them I had to manually display the validation errors. > > I

Re: Validation errors

2010-05-22 Thread Ed Propsner
changed or altered but I've been through 4 more forms since and with every one of them I had to manually display the validation errors. I guess I broke it 8-) On Sun, May 23, 2010 at 1:13 AM, Filipe Teles Rodrigues < filipe.t2...@gmail.com> wrote: > Have you done these models with bake

Re: Validation errors

2010-05-22 Thread Filipe Teles Rodrigues
Have you done these models with bake? If not, you could bake a model and see how it makes the forms, views, validations, etc. Maybe it helps. 2010/5/22 Ed Propsner > Now I'm really stumped. The new form I just created is having the same > problem with validation errors. > What am

Re: Validation errors

2010-05-22 Thread Ed Propsner
Now I'm really stumped. The new form I just created is having the same problem with validation errors. What am I overlooking here? On Sat, May 22, 2010 at 1:54 PM, Ed Propsner wrote: > Yup, I did and there was no problems with it. > > I think I'm to the point where I'm

Re: Validation errors

2010-05-22 Thread Ed Propsner
other form shortly and if the problem persists ... well, I dunno 8-) I was convinced it was something I was doing wrong because I have a handful of other forms that all function flawlessly with validation errors - this is the only one I had problems with. - Ed On Sat, May 22, 2010 at 1:45 PM, J

Re: Validation errors

2010-05-22 Thread John Andersen
Ok :) Have you tried to use the method described by Master Ram, just so it can be confirmed that the validation errors do get to the form helper? Enjoy, John On May 22, 8:39 pm, Ed Propsner wrote: > @john, > > Sorry about that. I was grasping at straws and scrapped everything and

Re: Validation errors

2010-05-22 Thread Ed Propsner
gt; > > > >> Hi, > > > > > > >> you could try this: > > > > > > >>http://cakeqs.org/eng/questions/view/validation_summary > > > > > > >> there are many posts about validation under cakephp questions, I > would > > >

Re: Validation errors

2010-05-22 Thread John Andersen
> > >> behaves correctly. > > > > >> Hope it helps. > > > > >> Matteo > > > > >> On May 22, 10:22 am, Ed Propsner wrote: > > > >> > @Master Ram > > > > >> > I appreciate the advice but doesn

Re: Validation errors

2010-05-22 Thread Ed Propsner
didn't. > > > > >> Then lastly I would try changing model name and check if validation > > >> behaves correctly. > > > > >> Hope it helps. > > > > >> Matteo > > > > >> On May 22, 10:22 am, Ed Propsner wrote: > > >> > @

Re: Validation errors

2010-05-22 Thread John Andersen
s seem a bit long winded for > >> > something that normally requires no code at all besides the validation > >> rules > >> > in the model? > > >> >  if ($form->isFieldError('Model_name.Field_name')){ > > >> >          

Re: Validation errors

2010-05-22 Thread Ed Propsner
or('Model_name.Field_name', >> > null, >> > array( >> > 'class' => 'failure') >> > )); >> > } >>

Re: Validation errors

2010-05-22 Thread Ed Propsner
error('Model_name.Field_name', > > null, > > array( > > 'class' => 'failure') > > )); > > } > > > > What if

Re: Validation errors

2010-05-22 Thread Matteo
>         } > > What if you have a form with say 20 fields that need to be validated? > > There is reason the validation errors are not outputting to the page, > instead of a work around I'd be more interested in finding the cause to the > problem. > > @Matteo, > >

Re: Validation errors

2010-05-22 Thread Ed Propsner
#x27;Model_name.Field_name', null, array( 'class' => 'failure') )); } What if you have a form with say 20 fields that need to be validated? There is reason the validation er

Re: Validation errors

2010-05-22 Thread Matteo
Hi, you can check my post here and see if it - maybe - fits your needs. Please, see last reply. http://groups.google.com/group/cake-php/browse_thread/thread/2f6a264df0492006 Matteo On May 22, 8:50 am, Ed Propsner wrote: > I have a form that is not displaying validation errors like it sho

Re: Validation errors

2010-05-22 Thread Master Ram...!
'class' => 'failure') )); } ?> try this i will work.. On Sat, May 22, 2010 at 12:20 PM, Ed Propsner wrote: > I have a form that is not displaying validation errors like it should be. > The errors are there in the vali

Validation errors

2010-05-21 Thread Ed Propsner
I have a form that is not displaying validation errors like it should be. The errors are there in the validationErrors array so the model is validating, I'm sure of that. I've been reading through a few other threads on the same subject but none of the causes seem to apply. I have the

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread euromark
labels and divs can be disabled by passing "false" in the options array have a look in the manual On 11 Mrz., 14:36, SeeVik wrote: > Thank you all for helping me out. I know how to customize $form- > > >input() to my liking now. > > Thanks for your help. > ShiVik > > On Mar 11, 9:48 pm, nurvzy

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread SeeVik
Thank you all for helping me out. I know how to customize $form- >input() to my liking now. Thanks for your help. ShiVik On Mar 11, 9:48 pm, nurvzy wrote: > As Euromark suggested, you should be using $form->input().  You can > really customize how you want $form->input to return output now.  You

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread nurvzy
As Euromark suggested, you should be using $form->input(). You can really customize how you want $form->input to return output now. You can turn labels off with $form->input('Model.field', array('label' => false)); If you insist on using those form helper elements you'll need to use $form->error

Re: Data Validation Errors not displaying!!!

2010-03-11 Thread SeeVik
If I use $form->input() then I will also have to use the label for the input field it will display, which I don't want to, since I want my label in some specific CSS style. Can't the error message be displayed using $form->text() and other such helpers? In cakephp 1.1 it was $html->tagErrorMsg but

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 > > create( 'Posts', array(

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( 'value' ); ?> end( 'Submit' ); ?> In my model Post.php I hav

how do you show validation errors in multi-model form?

2009-11-23 Thread Ernesto
Hello. i have a form like this one: echo $form->create("Order"); echo $form->input("code") for($i=0,$i<10,$i++) { echo $form->input("Item.$i.code"); echo $form->input("Item.$i.quantity"); } how do you show errors if more than 1 row fails validation? div @ the end of the form? -- You

Re: How to retrieve validation errors on model save?

2009-10-31 Thread j0n4s.h4rtm...@googlemail.com
If you are correctly validating within the model, add this to your app_model.php file: function validates($options = array()) { // Debug validation $errors = $this->invalidFields($options); if (is_array($errors) && !em

Re: How to retrieve validation errors on model save?

2009-10-30 Thread robustsolution
Dear will, it seems you are validating from the controller http://book.cakephp.org/view/410/Validating-Data-from-the-Controller On Oct 29, 9:08 pm, Will Poillion wrote: > Simple question: > > I'm attempting to save a model, and the data to be saved is not > passing the validation rules. How do

Re: How to retrieve validation errors on model save?

2009-10-29 Thread Miles J
Yes setFlash doesnt work in AJAX. If you want to use true ajax, return the success as a JSON response. On Oct 29, 8:57 pm, Will Poillion wrote: > Simple question: > > I'm attempting to save a model, and the data to be saved is not > passing the validation rules. How do I retrieve the validation

How to retrieve validation errors on model save?

2009-10-29 Thread Will Poillion
Simple question: I'm attempting to save a model, and the data to be saved is not passing the validation rules. How do I retrieve the validation error? if ($this->Ingredient->IngredientImage->save($this->data)) { //success $this->Session->setFlash(__('The Ingredient Image has been saved'

Re: How to retrieve validation errors on model save?

2009-10-29 Thread Miles J
Do not use invalidFields(), just use: $this->Model->validationErrors; invalidFields() causes your validation to run twice, which causes problems in some cases. On Oct 29, 5:50 pm, igotskils wrote: > On 29 Okt., 22:08, Will Poillion wrote: > > > > > Simple question: > > > I'm attempting to sav

Re: How to retrieve validation errors on model save?

2009-10-29 Thread igotskils
On 29 Okt., 22:08, Will Poillion wrote: > Simple question: > > I'm attempting to save a model, and the data to be saved is not > passing the validation rules. How do I retrieve the validation error? > > if ($this->Ingredient->IngredientImage->save($this->data)) { >         //success > $this->Se

How to retrieve validation errors on model save?

2009-10-29 Thread Will Poillion
Simple question: I'm attempting to save a model, and the data to be saved is not passing the validation rules. How do I retrieve the validation error? if ($this->Ingredient->IngredientImage->save($this->data)) { //success $this->Session->setFlash(__('The Ingredient Image has been saved'

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-18 Thread Amit Rawat
can you please tell me what validation rules are you applying? --~--~-~--~~~---~--~~ 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 g

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-18 Thread Sarah
, array('checked'=>$active)); (I replaced this code using the active data from the $this->data read, which actually simplified my code in both the controller and the view) I'm not sure what it is exactly about this code that breaks the validation errors. My guess is that si

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-18 Thread Sarah
Nevermind, it is now working. Thanks for your help! On Sep 18, 12:49 pm, Sarah wrote: > I'm not sure I understand what you mean.  I do not use an element for > the form.  I am unaware of any name for a form; I only create the form > with the model name.  I would appreciate it if would explain w

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-18 Thread Sarah
I'm not sure I understand what you mean. I do not use an element for the form. I am unaware of any name for a form; I only create the form with the model name. I would appreciate it if would explain what you are referring to. Thanks, ~Sarah On Sep 18, 5:08 am, Amit Rawat wrote: > Check your

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-18 Thread Amit Rawat
Check your edit view. Your form element name must be different in edit view as compared to add view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googl

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-18 Thread Bert Van den Brande
ty strings. The url is the same. > > > > Any ideas? > > > > Thanks, > > ~Sarah > > > > On Sep 17, 8:29 pm, "Dr. Loboto" wrote: > > > > > Don't do redirect after unsuccessful save, be sure that form URL is > > > sam

Re: Validation Errors Displaying on Add but not on Edit?

2009-09-17 Thread Sarah
he url is the same. > > Any ideas? > > Thanks, > ~Sarah > > On Sep 17, 8:29 pm, "Dr. Loboto" wrote: > > > Don't do redirect after unsuccessful save, be sure that form URL is > > same as your edit action. Presence of data in fields may indicate only

  1   2   >