Nobody has run into this? It is impossible to submit empty form fields
through Ajax with this new behavior in Prototype. The best solution is
to just switch forms to use normal POSTs, that's lame.

You can reproduce by doing my previous example, or even:

new Ajax.Request('/', { parameters: 'x=&y=&foo=bar' } )

Take a look at what was POSTed, it's not what you'd expect.

-justin

On Apr 17, 5:31 pm, mr_justin <[EMAIL PROTECTED]> wrote:
> I'm sure this has been covered before, but here goes...
>
> Anybody noticing some odd behavior with submitting forms through
> Ajax.Request? I thought at first it was a problem with Form.serialize,
> but was able to trace it back to line #975 (in prototype 1.5.1_rc2)
> which calls "toQueryParams" on the parameters that are passed into the
> new Ajax object if it is a string. This is the code (line #975 is the
> second line):
>
> if (typeof this.options.parameters == 'string')
>   this.options.parameters = this.options.parameters.toQueryParams();
>
> A quick example could be seen by running the following in Firebug:
> "foo=bar&apple=&orange=".toQueryParams()
>
> The apple and orange parameters are left off due to being empty. In
> terms of forms and empty fields (which should trigger validation
> errors), this seems like a huge problem.
>
> Is my version of prototype just out-of-date or is there a fix for this
> in the foreseeable future? I know I can extend/override to fix this
> behavior. I'm not looking for a fix, just wondering if anybody else
> has seen this.
>
> -justin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to