Prevent inputs and buttons of type="button" from getting the submit click handler added to them.

This commit is contained in:
Kin Blas 2011-03-01 14:04:48 -08:00
parent df21c701b5
commit 48ab0ec7d6

View file

@ -35,7 +35,8 @@ $.widget( "mobile.button", $.mobile.widget, {
.append( $el.addClass('ui-btn-hidden') );
//add hidden input during submit
if( $el.attr('type') !== 'reset' ){
var type = $el.attr('type');
if( type !== 'button' && type !== 'reset' ){
$el.click(function(){
var $buttonPlaceholder = $("<input>",
{type: "hidden", name: $el.attr("name"), value: $el.attr("value")})