pop the value into your bind array before you bind the form to it. > $form->bind($request->getParameter($form->getName()),
..oO David Wang Oo.. ..oO blog - http://www.udfi.biz ..oO JennieBot - www.jenniebot.com - helping you be a better you! On Aug 24, 2009, at 1:07 PM, Germana Oliveira wrote: > > I have this issue: > > I have a form, it has 3 fields that shows a defauls values, this > defauls > values are show in pure text, because the user can not modifies it. I > dont want to put an input hidden because it can be modified easily by > tool like fireBug. So i wonder if i can set the values internally > before > i save the form??? > > I have this for now: > > public function executeNew(sfWebRequest $request) > { > $empleado_id = $this->getUser()->getEmpleadoUsuario('id'); > if(!$empleado_id) { $this->redirect('default/ > errorEmpleadoUsuario'); } > > $this->params = array( > 'empleado_id' => $request->setParameter('empleado_id', > $empleado_id), > 'empleado' => > $request->setParameter('empleado',$this->getUser()- > >getEmpleadoUsuario('nombre')), > 'fecha' => > $request->setParameter('fecha',date('d').'-'.date('m').'-'.date('Y')), > 'correlativo' => > $request->setParameter('correlativo',$this- > >getDenunciaDia().'-'.date('M').date('y')) > ); > $this->form = new DenunciaForm(); > } > > protected function processForm(sfWebRequest $request, sfForm $form) > { > $form->bind($request->getParameter($form->getName()), > $request->getFiles($form->getName())); > > if ($form->isValid()) > { > $denuncia = $form->save(); > $this->redirect('denuncia/index'); > } > } > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@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 -~----------~----~----~----~------~----~------~--~---