title: How do I access another field using vuelidate
body: <p>I'm making some validators on a form for shipping using vuelidate. Currently I'm checcking if the postalCode is in the right format. This field is dependent on the country field though (because different countries have different postal code formats. I'm having trouble accessing the viewmodel itself though, and I don't get the explanation in vuelidates docs.</p>
  <p>Currently I'm working with the following redacted code:</p>
  <pre class="lang-js prettyprint-override"><code>import Vue from 'vue';
  import {validationMixin} from 'vuelidate';
  import {required} from 'vuelidate/lib/validators';
  import {getEuMembers} from 'is-eu-member';
  import countries from 'i18n-iso-countries';
  import postalCodes from 'postal-codes-js';
  new Vue({
    el: '#app',
    mixins: [shoppingBagMixin, validationMixin],
    data: {
      form: {
        country: {},
        postalCode: '',
        // more data...
      },
    },
    validations: {
      form: {
        $each: {required},
        country: {
        },
        postalCode: {
  // ----------- The following 3 lines are problematic ----------
          validPostalCode: (value) =&gt; { 
            if (!this.country || !this.country.code) return false; 
            return postalCodes.validate(this.country.code, value);
          },
        },
      },
    },
  methods: {
      euCountries: euCountries,
      async onSubmit(event) {
        this.$v.$touch();
        if (this.$v.$invalid) {
          return false; // TODO: Show error
        }
  
        // Sending data using fetch()
  
        return false;
      },
    },
  });
  
  /**
   * Returns a list of EU country codes and translated names
   * @param {String} lang Language to translate the country name to.
   * Needs to be a code such as 'nl' or 'en'
   * @return {Array} Array of {code: ISOCode, name: name} objects
   */
  function euCountries(lang) {
    countries.registerLocale(require(`i18n-iso-countries/langs/${lang}.json`));
    return getEuMembers().map((ISOCode) =&gt; {
      const name = countries.getName(ISOCode, lang, {});
      return {code: ISOCode, name: name};
    });
  }
  </code></pre>
  <p>for completeness, a snippet of the form:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;fieldset&gt;
    &lt;legend&gt;Adres:&lt;/legend&gt;
    &lt;label for=&quot;country&quot;&gt;Land:&lt;/label&gt;
    &lt;select id=&quot;country&quot; name=&quot;country&quot; v-model=&quot;form.country&quot; type=&quot;text&quot;&gt;
      &lt;option v-once v-for=&quot;country in euCountries('nl')&quot; :value=&quot;country&quot;&gt;{{country.name}}&lt;/option&gt;
    &lt;/select&gt;
    &lt;label for=&quot;postalCode&quot;&gt;Postcode:&lt;/label&gt;
    &lt;input id=&quot;postalCode&quot; name=&quot;postalCode&quot; v-model=&quot;form.postalCode&quot; type=&quot;text&quot;&gt;
  &lt;/fieldset&gt;
  </code></pre>