Your should just be able to return the string... function checkCheese(tilsit, caerphilly, cheddar) { if (!tilsit) { return "Never at the end of the week, sir. Always get it fresh first thing on Monday."; } if (!caerphilly) { return "Ah well, it's been on order for two weeks, sir. I was expecting it this morning."; } if (!cheddar) { return "Well, I'm afraid we don't get much call for it around these parts"; } return true; }
hth grigri On Jul 9, 12:12 pm, emanuele <emanuel...@gmail.com> wrote: > Hello pals, I ve my own validation method. The method checks three fields. > Is there any possibility to customize the message of error depending on the > failure condtions? For istance: > > function myfunc(a, b, c) { > if(!a) > set a message for a; > elseif(!b) set a message for b; > elseif(!c) set a message for c; > > } > > thanks in advance > -- > Emanuele Gringeri > Computer Engineer > University of Pisa > Be my mirror, my sword and shield 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 from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en