I suppose this is actually 2 bugs in 1.

Firstly, Form.serialize only serializes the first input[type="submit"] button.

In Form.serializeElements(), the variable submitted is set when the
first submit button is serialized, inhibiting the serialization of
other submit buttons.

Secondly, the pressed button (if one was pressed) should be serialized.

Is there anything that can be done about this behaviour?

The only way I can think of is to add a property to the form
indicating which submit button was clicked and then serialize that
button, rather than the first one.

Having multiple submit buttons is fine according the HTML 4.01

Also ... "A button (and its value) is only included in the form
submission if the button itself was used to initiate the form

As a consequence, submitting a form via AJAX doesn't supply the
appropriate button.

Or that is what is happening to me.



Example (http://pastie.org/402166) :

<script type="text/javascript"
<script type="text/javascript">
document.observe('dom:loaded', function() {
 $('seri').observe('submit', function(ev) {
 <form id="seri" method="post" action="">
  <select id="aSelector" name="bob">
   <option value="1">One</option>
   <option value="2">Two</option>
   <option value="3">Three</option>
   <option value="4">Four</option>
  <input type="submit" id="tabRG_PDF" name="tabRG_ReportType[31]"
value="Adobe Acrobat PDF" />
  <input type="submit" id="tabRG_Excel" name="tabRG_ReportType[36]"
value="Microsoft Excel Spreadsheet" />
  <input type="submit" id="tabRG_Word" name="tabRG_ReportType[14]"
value="Microsoft Word Document" />
  <input type="reset" id="tabRG_Reset" name="tabRG_Reset" value="Discard" />

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 
For more options, visit this group at 

Reply via email to