spree-contrib / better_spree_paypal_express

A better Spree PayPal Express Extension.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
110 stars 269 forks source link

Switch .attr() to .prop() for disabling form els #56

Closed dpritchett closed 10 years ago

dpritchett commented 10 years ago

Replacing calls to .attr('disabled', '') with .prop('disabled', '') fixes #54 on 2-0-stable.

From the jQuery docs on .attr():

As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

I'm no jQuery expert, but it seems to have fixed my problem locally. Here's a gist of my full deface override: https://gist.github.com/dpritchett/7256ea124f0aa6e272fb

radar commented 10 years ago

Thanks @dpritchett. I've added this to 2-0-stable, 2-1-stable and master.