recurly/recurly-js — Issue #25: Bug with unbinding validated input
Author: bolchowka
Created: 2012-01-30 11:18:14+00:00
State: open

Recurly.js 2.0.0 has a significant bug with validating inputs. Previous version may suffer from this as well.

Line #1096 tries to .unbind the function bound to 'change keyup' events:

```js
$input.unbind(handler);
```

However, .unbind function requires the event object to be passed as an argument, not a callback function.
Lines #1091-1098 should be changed like this to fix that:

```js
$input.bind('change keyup', function handler(ev) {

if(validator($input)) {
$input.removeClass('invalid');
$e.remove();
$input.unbind(ev);
}
});
```

Sorry for not posting that to a Git repo, but I'm not yet using Git.