[Seaside] jquery serialization question
ljw1001 at gmail.com
Sun Oct 16 15:03:50 UTC 2011
Thanks guys. That was it!
Sent from my iPhone
On Oct 16, 2011, at 10:35 AM, Lukas Renggli <renggli at gmail.com> wrote:
>> I'm trying to serialize a form containing a single testArea when the
>> submit button is clicked. I have an onClick handler for the submit
>> button that does this:
>> (html jQuery ajax serializeForm
>> (html jQuery ajax
>> script: [ :s |
>> s add: ((html jQuery: #postStatusTextArea) value: '').
>> s add: ((html jQuery: #activityStream) prepend:
>> (CBActivityComponent post: self session user posts first)) ]) );
> - There is a cascade semicolon missing after #serializeForm, but it
> probably doesn't matter much.
> - You likely want to return false to the click handler, otherwise a
> full submit will be triggered. You can do this by adding
> (html jQuery ajax
> onSuccess: ...;
> return: false)
>> If I execute this by clicking the button the callback for the textArea
>> gets invoked twice most of the time (though not every time).
> If the AJAX call is faster you get the AJAX submit, then a full submit.
> If the full submit is faster, the AJAX call is cancelled by the
> browser and you get only one submit.
> Lukas Renggli
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside