[symfony-users] Re: ajax in symfony 2

2011-04-20 Thread symfonyMan
Hello Oscar, Thanks you for this nice replay :) yes this work now have a good day On 20 avr, 00:43, oscar balladares wrote: > Oh, for sure. > > If you want just to validate a field with ajax and a controller you probably > need to grep > the EmailField value and attach it to a variable. > > If

Re: [symfony-users] Re: ajax in symfony 2

2011-04-19 Thread oscar balladares
Oh, for sure. If you want just to validate a field with ajax and a controller you probably need to grep the EmailField value and attach it to a variable. If you instead want to submit the whole form with JQuery and Ajax you should want to use the .serialize() function (of JQuery + Ajax) So the

[symfony-users] Re: ajax in symfony 2

2011-04-18 Thread symfonyMan
Hello Oscar, thanks you for the replays.. can you show me an exemple of sending an ajax request with jquery ?? i tried a lot of things (.ajax(), .get()...) but il my ajaxAction, this test is skipped : (not an XMLHttpRequest()) if ($this->container->get('request')->isXmlHttpRequest()) {

Re: [symfony-users] Re: ajax in symfony 2

2011-04-16 Thread oscar balladares
If you just want to return a simple string you probably want to: # Controllers definition { #some logic here return new Response("There are some errors on this field"); ... You must import the namespace for Response : use Symfony\Component\HttpFoundation\Response; 2011/4/15 symfonyM

[symfony-users] Re: ajax in symfony 2

2011-04-15 Thread symfonyMan
Hello, thanks for all this responses. the controller must return a template ? Me, I need ajax just for validate email, and print "ok" next to the email field... sorry i have a bad english :) thnaks On 15 avr, 00:12, oscar balladares wrote: > The controller should return a template response,

Re: [symfony-users] Re: ajax in symfony 2

2011-04-14 Thread oscar balladares
The controller should return a template response, a common template (without inheritance of course) 2011/4/14 oscar balladares > With JQuery you can request Marc's controller's route. That should do the > trick. > > > 2011/4/14 Marc MacLeod > >> In your controller: >> >>public function fooA

Re: [symfony-users] Re: ajax in symfony 2

2011-04-14 Thread oscar balladares
With JQuery you can request Marc's controller's route. That should do the trick. 2011/4/14 Marc MacLeod > In your controller: > >public function fooAction() >{ >// Is this an ajax request? >if ($this->container->get('request')->isXmlHttpRequest()) >{ >

[symfony-users] Re: ajax in symfony 2

2011-04-14 Thread Marc MacLeod
In your controller: public function fooAction() { // Is this an ajax request? if ($this->container->get('request')->isXmlHttpRequest()) { // do stuff and return ajax content } // return normal response } On Apr 13, 5:16 am, symfonyM