[Seaside] Simple Form Submission via JQuery ajax

Esteban A. Maringolo emaringolo at gmail.com
Thu Jan 9 19:20:35 UTC 2014


I have a simple FORM with a SELECT element together with a SUBMIT button.

html form
with: [
 html select
   list: self availableGroupSelectors;
   labels: [:x | self labelFor: x];
   selected: self group;
   callback: [:x | self group: x ].
 html space.
 html submitButton with: 'Update'.
  ]
]


What should I do if I want to make this form work "ajaxified", it
is... to make a request in the background, and replace the content of
a DIV element (with an already defined id).

Something like adding ("pseudo" code):
html submitButton onClick: ((html jQuery id: divId) load html: [
:ajaxHtml | self renderNewContentOn: ajaxHtml ]).

Maybe I can avoid using a submitButton, or return false at the end of
the onClick handler. It doesn't matter. I just want to be able to
render the new content using the selected value in the SELECT element.

I might have a few extra parameters (input elements), but I guess the
method will be same.

Regards,


Esteban A. Maringolo


More information about the seaside mailing list