Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Not possible to use validation groups with radio inputs #234

Closed
priithansen opened this issue May 17, 2016 · 1 comment
Closed

Not possible to use validation groups with radio inputs #234

priithansen opened this issue May 17, 2016 · 1 comment

Comments

@priithansen
Copy link

vue & vue-validator version

1.0.24, 2.1.1

Reproduction Link

https://jsfiddle.net/gfd06j7o/

Steps to reproduce

1 - Add group="group1" to one or both radio inputs in the jsfiddler.

What is Expected?

Possible to validate radio inputs based on groups like described in docs http://vuejs.github.io/vue-validator/en/grouping.html for regular inputs

What is actually happening?

vue-validator.js:1912 - Uncaught TypeError: Cannot read property 'validation' of undefined

which is the "var validation =" line in the following code snippet

  Validator.prototype.addGroupValidation = function addGroupValidation(group, field) {
      var indexOf = exports$1.Vue.util.indexOf;

      var validation = this._validations[field] || this._checkboxValidations[field].validation || this._radioValidations[field].validation;
      var validations = this._groupValidations[group];

      validations && ! ~indexOf(validations, validation) && validations.push(validation);
    };
@priithansen
Copy link
Author

Awesome!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants