I found this to be an interesting problem, so I decided that I would work a bit in the jquery source code and the api documentation.
My findings:
Your problem has nothing to do with ajax call and everything related to the $.serialize() function. It just isn't encoded to return <input type="submit"> or even <button type="submit"> , I tried both. There is a regular expression expression that runs against multiple elements in a form that needs to be serialized, and it arbitrarily excludes the submit button, unfortunately.
JQuery source code (I am modified for debugging purposes, but everything is still semantically untouched):
serialize: function() { var data = jQuery.param( this.serializeArray() ); return data; }, serializeArray: function() { var elementMap = this.map(function(){ return this.elements ? jQuery.makeArray( this.elements ) : this; }); var filtered = elementMap.filter(function(){ var regexTest1= rselectTextarea.test( this.nodeName ); var regexTest2 = rinput.test( this.type );
Now, while studying jQuery documentation, you meet all the requirements for it as you need (http://api.jquery.com/serialize/):
Note. Only " successful controls " are serialized into a string. The submit button value is not serialized because the form was not submitted using the button. For the value of the form element to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (radio or flag inputs) are only included if they are checked. Data from file selection items is not serialized.
"The successful management link is associated with the W3 specification, and you definitely nailed the expected behavior in the specification.
Short lame answer: I think it is broken! Report a bug!
source share