Hi,

That's what I do :

First make it work without ajax and use partial in your template.
Example :
action: executeMyForm()
template: myFormSuccess().php // what you don't want to be refreshed
in your ajax call
with a partial: _form.php // the piece of html you actually want to
refresh

then use in your action :
if( $this->getRequest()->isXmlHttpRequest() ){
  return $this->renderPartial('form', array('form'=>$form));
}

If you would like to use JSON :
if( $this->getRequest()->isXmlHttpRequest() )
{
  $response = array();
  $response['content'] = $this->getPartial('my_partial', array('data'=>
$data) ); // or getComponent
  $this->getResponse()->setHttpHeader('Content-type', 'application/
json');
  return $this->renderText( json_encode($response) );
}


On Apr 23, 12:00 am, tasse Dethe <chaiseenb...@gmail.com> wrote:
> Hello,
>
> i made a post on symfony forum 
> :http://forum.symfony-project.org/index.php/m/97874/#msg_97874
>
> I want to use AJAX to  validate what the user typing in forms when he's
> typing it.
>
> I manage to include and call my ajaxfunction but as i'am a beginner in AJAX,
> i can't make it working.
>
> Can someone explain me the good manner to use AJAX wiwth symfony 1.4 ?
>
> (My code is posted on the symfony forum )
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> 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 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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

Reply via email to