Cristiano Magro
10 days ago 9f20397f5fa48aa2ba0b48f47ebc3c853dfd1137
11 - Forms/xno-forms-01-starting-setup/src/components/TheForm.vue
@@ -6,11 +6,11 @@
    </div>
    <div class="form-control">
      <label for="age">Your Age (Years)</label>
      <input id="age" name="age" type="number" v-model="userAge" ref="inputAge"/>
      <input id="age" name="age" type="number" v-model="userAge" ref="inputAge" />
    </div>
    <div class="form-control">
      <label for="referrer">How did you hear about us?</label>
      <select id="referrer" name="referrer">
      <select id="referrer" name="referrer" v-model="referrer">
        <option value="google">Google</option>
        <option value="wom">Word of mouth</option>
        <option value="newspaper">Newspaper</option>
@@ -58,16 +58,20 @@
    return {
      userName: '',
      userAge: null,
      referrer: 'wom',
    }
  },
  methods: {
    submitForm() {
      console.log('Username: ' + this.userName);
      this.userName = '';
      console.log('User age: '); // + this.userName);
      console.log(this.userAge);
      console.log(this.$refs.inputAge.value);
      console.log(18); // + this.userName);
      console.log('User age: ');
      console.log(this.userAge); //number
      console.log(this.$refs.inputAge.value);  //string
      console.log(18);
      console.log('referrer: ' + this.referrer);
      this.referrer = 'wom';
      this.userAge = null;
    }