On Feb 12, 9:25 am, Mislav Marohnić <[email protected]> wrote:
> On Wed, Feb 4, 2009 at 23:08, joe t. <[email protected]> wrote:
>
> > i've had an ongoing need to make Form#request less dependent on the
> > FORM's action attribute.
>
> The sole purpose of Form#request is to wrap an Ajax.Request call to make it
> use the form's "action" and "method" attributes. In short, it completely
> simulates (with the exception of file uploads) the way a web browser would
> serialize and submit a form.
>
> If you find yourself wanting another action URL or HTTP method, you
> definitely *don't want* to use Form#request. A much better solution is
> manually using Ajax.Request + Form#serialize (as you already mentioned).
>
> I strongly advise against the writeAttribute hack. Form#request was designed
> to support unobtrusive scripting by hijacking form submits; and by using
> this hack you're defying the purpose of Form#request as well as making your
> scripts obtrusive (by changing the "action" attribute unnecessarily).
>
> You are encouraged to use Element.addMethods to add a new method like
> Form#requestWithAction(url, options).

Thank you for the perspective Mislav. i know that #writeAttribute
isn't 100% reliable, which was part of the reason why i was looking
for an alternative to it.

i'll do some more thinking about my approach. Thanks again for the
insight.
-joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to