2009/2/27 Richard Quadling <rquadl...@googlemail.com>:
> 2009/2/27 Mislav Marohnić <mislav.maroh...@gmail.com>:
>> On Fri, Feb 27, 2009 at 17:18, Richard Quadling <rquadl...@googlemail.com>
>> wrote:
>>>
>>> Firstly, Form.serialize only serializes the first input[type="submit"]
>>> button.
>>
>> That is what browser does, too, when you press Enter while in a text input
>> field.
>>>
>>> Secondly, the pressed button (if one was pressed) should be serialized.
>>
>> And how would you go about detecting which button was pressed?
>> There is no API in JavaScript to detect this while processing the "submit"
>> event.
>>
>>>
>>> Is there anything that can be done about this behaviour?
>>
>> Yes: http://gist.github.com/71574
>> In user code. If you have any ideas how to implement this in the framework,
>> let us know.
>> >>
>>
>
> I think I'll populate a <input type="hidden"> when a submit is
> pressed. That way serialize will work without amendments.
>
> Thank you.
>
> Richard.
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
>

Advertising

Just so you don't all think I'm a total buffoon, observing a form's
submit event is where I was going wrong.
I should be watching the submit buttons click event to determine the
submit type.
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---