jQuery Mobile breaks jQuery.serializeArray() by including submit button #3925

Closed
kborchers opened this Issue Mar 27, 2012 · 5 comments

Comments

Projects
None yet
5 participants
@kborchers
Member

kborchers commented Mar 27, 2012

If you take a look at http://jsfiddle.net/kborchers/Amf5x/3/, you'll see that when you fill out the form, the array that is logged contains the submit button but the exact same code here without jQuery Mobile http://jsfiddle.net/kborchers/Amf5x/4/ does not include the submit button. I would imagine that the submit button should not be there which is why I am filing the issue here and not in core. Also, the same issue exists here http://jsfiddle.net/kborchers/Amf5x/5/ with latest jQM and jQ1.7.1.

@jblas

This comment has been minimized.

Show comment
Hide comment
@jblas

jblas Mar 27, 2012

Contributor

This is due to the buttonPlaceholder that gets injected in jquery.mobile.forms.button.js

https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.forms.button.js#L78

Contributor

jblas commented Mar 27, 2012

This is due to the buttonPlaceholder that gets injected in jquery.mobile.forms.button.js

https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.forms.button.js#L78

@ghost ghost assigned jasondscott May 24, 2012

@jasondscott

This comment has been minimized.

Show comment
Hide comment
@jasondscott

jasondscott Aug 9, 2012

Contributor

@kborchers Looking at the JQM code this seems intentional if the submit button has a name attribute. See ecc1361

Maybe @Wilto could shed light onto why we do this.

Contributor

jasondscott commented Aug 9, 2012

@kborchers Looking at the JQM code this seems intentional if the submit button has a name attribute. See ecc1361

Maybe @Wilto could shed light onto why we do this.

@scottjehl

This comment has been minimized.

Show comment
Hide comment
@scottjehl

scottjehl Aug 9, 2012

Contributor

Yep, that's the case. People often use submit buttons with different name/values so we made sure they're serialized along with the rest of the form. Maybe core needs to do the same.. I'm not sure why it doesn't include submit buttons by default.

Contributor

scottjehl commented Aug 9, 2012

Yep, that's the case. People often use submit buttons with different name/values so we made sure they're serialized along with the rest of the form. Maybe core needs to do the same.. I'm not sure why it doesn't include submit buttons by default.

@jasondscott

This comment has been minimized.

Show comment
Hide comment
@jasondscott

jasondscott Aug 15, 2012

Contributor

@scottjehl should we close this issue?

Contributor

jasondscott commented Aug 15, 2012

@scottjehl should we close this issue?

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Aug 7, 2013

Member

this is fixed in latest http://jsfiddle.net/Amf5x/7/

Member

arschmitz commented Aug 7, 2013

this is fixed in latest http://jsfiddle.net/Amf5x/7/

@arschmitz arschmitz closed this Aug 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment