Hi,
We are trying to use multiple submit buttons in the same form to tie to
different actions on the server side.
For example:
This works with non-AJAX type requests. However, now that we are trying
to
do the same with AJAX, it is not working. Whichever button we press, we
get
the value of the first button on the form being passed as a parameter to
the
server. It looks like to me the problem might be related to how Rails
generates its buttons with the same name (commit) but different values.
Is
this legal in AJAX? Does AJAX use DOM? Is there a work-around for this?
The parameters hash looks like…
“commit” => “edit”
even if we press the “cancel” or “test configuration” buttons.
I have Googled about but haven’t found any answers. Can anyone point me
in
the right direction or recommend a good book on AJAX?
Any help would be appreciated. Thanks,
cn