Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prevent inputs and buttons of type="button" from getting the submit c…

…lick handler added to them.
  • Loading branch information...
commit 48ab0ec7d601ade827078b6f87d197a63b504f84 1 parent df21c70
@jblas jblas authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  js/jquery.mobile.forms.button.js
View
3  js/jquery.mobile.forms.button.js
@@ -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")})
Please sign in to comment.
Something went wrong with that request. Please try again.