This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.0 » Form didn't return errors
icon9.gif  Form didn't return errors [message #100222] Wed, 02 June 2010 10:29
bahamut100  is currently offline bahamut100
Messages: 3
Registered: May 2010
Junior Member
Hi,

I have a problem with my form and ajax.

Indeed, when the form is correctly fillin, datas are send into the database, but when the form is not correctly fillin, the errors "this input is required..." are never displayed (in spite of I have a validator for this).

This is my code of my action.class :


public function executeDetails()
{
$c = new Criteria();
$c -> add(ReunionPeer::ID_REUNION,
      $this->getRequestParameter('id'));
$this->zone = ReunionPeer::doSelectOne($c);

}
  
public function executeAjoutvalid()
{

$inscrit=new InscritReunion();
$inscrit->setIdReunion($this->getRequestParameter('id_reunion'));
$inscrit->setMailInscrit($this->getRequestparameter('mail'));
$inscrit->save();
	
}
  
public function handleErrorAjoutvalid()
{
	return sfView::ERROR;
	
}



And this is the code of my template :

<div id="statut_inscription" style="display:none">
<?php if ($sf_request->hasErrors()): ?>
  <p><? echo ('Form not correct !!')?> :</p>
  <ul>
    <?php foreach($sf_request->getErrors() as $name => $error): ?>
      <ol><?php echo $error ?></ol>
    <?php endforeach; ?>
  </ul>
<?php endif ?>
</div>
<div id="inscription_reunion">


<?php 


echo form_remote_tag(array(
	"url" =>'reunion/ajoutvalid',
	'update'  => array('success' => 'statut_inscription',  'failure' => 'statut_inscription'),
  	'script'  => true,
	'loading' => "Element.show('indicator')",
    'success' => "Element.hide('indicator');Element.show('statut_inscription');Element.hide('inscription_reunion');",
	'failure' => "Element.hide('indicator');"), array( "name" => "ajoutvalid"));

//Then, I have the inputs and the submit button

?>


And this te url to see my form :

http://myproject/reunion/details/id/4

Have you an idea ?
Previous Topic:Other - IP blocking for a specific page element in a symfony 1.0 project
Next Topic:sf_params and select_tag multiple
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software