Ajax and onsubmit

I’ve worked through the depot app and would like to use the ajax submit
ability, but call it from a textbox’s onblur event. By using onblur I
can submit the form, but the ‘onsubmit’ part isn’t fired.

Is there a way to either fire the onsubmit event, or to copy that code
into a text_field? I tried a direct copy from the source of the form
just to test it out without success.

the following didn’t work for item 4:
%= text_field ‘item’, ‘name’, :size => 3, :value => item.name,
:onblur=> “new Ajax.Request(’/store/add_to_cart/4’,
{asynchronous:true, evalScripts:true, parameters:Form.serialize(this)});
return false;” %>

Anyone have experience with this?

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