I just tried it and it works really well! Thank you! :) On Wed, Dec 30, 2009 at 10:35 PM, Alexandru-Emil Lupu <gang.al...@gmail.com> wrote: > in my Form class object i ave added : > > > > public function getErrors($v = '') > { > foreach ($this->getErrorSchema() as $field=>$error ) > { > foreach ($error->getErrors() as $currentError) > { > $v .= '<li>'.sprintf("In the "%s" tab you have an > error:<br> <strong>%s</strong>", $field , > $currentError->getMessage()).'</li>'; > } > } > return $v; > } > > After that, in my view i have added : > > <?php if ($form->hasErrors()):?> > <div id="contact_form_errors"> > <ul><?php echo $form->getErrors()?></ul> > </div> > <?php endif;?> > > As my implementation has different tabs, your output (copy pasted from me) > will output you some error messages like: > > In the "Contact" tab you have an error: Name: required > > Alecs > > On Wed, Dec 30, 2009 at 11:02 AM, Alexandru-Emil Lupu <gang.al...@gmail.com> > wrote: >> I have done something like that. I will post my solution later today, as i >> haven't yet start my computer >> Alecs >> >> sent via htc magic >> >> On Dec 30, 2009 1:37 AM, "Sid Bachtiar" <sid.bacht...@gmail.com> wrote: >> >> Hi all, >> >> I embedded a form inside another form, and I try to print errors (of >> all the forms combined) like this in the template: >> >> >> <?php foreach ($form->getErrorSchema()->getErrors() >> as $error): ?> >> *<?php echo $error->getMessage(); ?><br/> >> <?php endforeach; ?> >> >> It is able to print all the errors as expected so that's good. But for >> the embedded form fields, the required error message always show: >> >> *0 [Reply to Sid is missing.] >> >> Instead of just: >> >> * Reply to Sid is missing >> >> The 0 is the field name. I want to get rid of it (and the brackets) >> and tried many ways without success. >> >> Does anyone know how to just print the error message without the field >> name and the brackets?? >> >> Cheers, >> >> Sid >> -- >> Blue Horn Ltd - System Development >> http://bluehorn.co.nz >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "symfony users" group. >> To post to this group, send email to symfony-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> symfony-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en. >> >> >> > > > > -- > Have a nice day! > Alecs > > As programmers create bigger & better idiot proof programs, so the universe > creates bigger & better idiots! > I am on web: http://www.alecslupu.ro/ > I am on twitter: http://twitter.com/alecslupu > I am on linkedIn: http://www.linkedin.com/in/alecslupu > Tel: (+4)0748.543.798 > > > -- > > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to symfony-us...@googlegroups.com. > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. >
-- Blue Horn Ltd - System Development http://bluehorn.co.nz -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.