On the server side, you'd do it by assigning a name/value pair.
In Javascript the first thing I'd try is making sure the event object
is passed to onsubmit (either with bindAsEventListener or
Event.observe). Then test the properties of the event object to see
if there is something useful there. Perhaps Event.element() might
hold a useful value.
e.g.
myForm.onsubmit = function (evt) {
// ...
// alert(Event.element(evt));
// for (prop in evt) {console.log(prop +': ' +evt[prop];}
// ...
}.bindAsEventListener(myForm);
If all else fails, you can tie an onclick event to one of the buttons
to differentiate behaviors.
TAG
On May 31, 2007, at 6:42 AM, gimler wrote:
>
> hello,
>
> i have the following code:
> document.getElementById('post_edit_form').onsubmit = function () {
> alert(???);
>
> my question is how can i get the value of the submit button (i have to
> buttons)?
>
> Can anybody help me?
>
> greetings
> Gordon
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---