Form with xhr and regular submits

Hey All,

I’m wondering if it’s possible to have a form with 2 submit buttons,
where one submit button whould submit the form via xhr and the other
would be a regular submit.

Possible? As simple as dynamically removing the ‘date-remote’
attribute from the form?



On Nov 17, 2011, at 1:01 PM, Curtis Schiewek wrote:


I don’t know how to do this in jQuery, but in Prototype it’s as easy as

:onclick => ‘return this.up(‘form’).request();’

And you wouldn’t need to set data-remote on the form at all. The other
submit button would naturally just submit the form. If you wanted to get
the inline JavaScript out of your view, you would simply add an ID to
the submit button, and observe it from a dom:loaded listener:




This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs