17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1291 Views |
-
Make forms 'Ajaxy'

29 September 2007 at 10:37am
I'm going to want some forms of mine enhanced with ajax.
Now I know how to do this the normal way, but haven't got a single clue on how to do it in SS. Where should I send my request to? To the controller.php? Or do I make a complete new controller for it?
I also came across 'FormResponse' and 'AjaxActionForm' but the documentation didn't make me a lot wiser... Is there anybody here with some experience / or some examples?
And if you know the answer, please take a look at what I'm doing wrong here: http://www.silverstripe.com/silverstripe-development/flat/5780?showPost=6157#post6157
Thanks!
-
Re: Make forms 'Ajaxy'

29 September 2007 at 1:43pm
Hm, just use the normal form action thats generated by the form, submitted by an ajax-call instead of a normal POST-request (e.g. by prototype's Ajax.Request-object).
AjaxFormAction isn't really needed for this, afaik its mostly specific to the backend where all "normal" actions in a form are processed a bit differently to build the "button-bar" you see in the interface.
FormResponse is a nice wrapper that lets you create responses for ajax/non-ajax calls (e.g. returning json vs. a full html-page). it determines automatically the format you need, and has some other useful functions like refreshing a cms-form with reapplying javascript-behaviour.
-
Re: Make forms 'Ajaxy'

29 September 2007 at 8:45pm
Mm, I'll give it a try the 'normal way'. Don't run too far as I'll probably be coming back on this one
I looked into formResponse but it didn't make me a lot wiser... and when I clicked the documentation-link I was presented with an login - box.
| 1291 Views | ||
|
Page:
1
|
Go to Top |


