Oh, finally I found the original thread.

I have exactly the same problem and tried everything the last 3 days
and no positive result.
So I hope somebody could help us out here.

I already validated my json response and reduced the source to a
minimum checkout where the problem could be...

------

{"content":"<form method=\"post\" action=\"content\/users\/avatar\" id=
\"anothername\" enctype=\"multipart\/form-data\">\n\t<input type=\"file
\" name=\"avatar\" \/>\n\t<input type=\"submit\" value=\"make this\" \/
>\n<\/form>1"}

------

So I think it's valid... but when I change the "echo" after first page
load and write

{"test":"hello world"}

and submit the form,.. my success callback fires!
This makes me feel a bit stupid.

Anyone who could help?
Thank you!
On Jan 6, 6:53 pm, Scott Brady <dsbr...@gmail.com> wrote:
> Thanks! I'll try that.
>
> I have an idea what it might be, but that code is at home.  I think I
> might not be getting rid of the prefix ColdFusion adds to json
> responses -- I'll have to see if there's a preprocessing directive
> likejquery'sbuilt in ajax calls have.
>
> Scott
>
>
>
>
>
> On Wed, Jan 6, 2010 at 9:08 AM, Mike Alsup <mal...@gmail.com> wrote:
> > What you have there should be working.  Perhaps the json response is
> > not properly formatting.  Try adding an error callback, or using the
> > global ajaxError hook, and see if that's the problem.
>
> > Mike
>
> > On Jan 5, 8:20 pm, Scott Brady <dsbr...@gmail.com> wrote:
> >> I'm having an issue using thejqueryformplug-in.  Theformgets
> >> submitted just fine (I can see the response in Firebug).  However, it
> >> looks like mysuccesscallback method isn't being called.
>
> >> Here's the basic JS code for theformsubmit in the "document.ready" 
> >> section.:
> >>                // Addformbinding
> >>                var addOptions =
> >>                {
> >>                        dataType: 'json',
> >>                        resetForm: true,
> >>                        success: processAdd
> >>                };
>
> >>                $("#addForm").ajaxForm(addOptions);
>
> >> And, here's the callback function:
> >> function processAdd(responseData, statusText)
> >> {
> >> alert(responseData);
>
> >> }
>
> >> I've tried changing thesuccessbe an inline function declaration
> >> (success: function(responseText){ ... etc) but that didn't change it.
>
> >> Would using ajaxSubmit() rather than ajaxForm() work better?  Or, is
> >> there something I'm actually doing wrong that you can see?
>
> >> --
> >> -----------------------------------------
> >> Scott Brady
>
> --
> -----------------------------------------
> Scott Bradyhttp://www.scottbrady.net/

Reply via email to