| | |
| | | </div> |
| | | <div class="form-control"> |
| | | <label for="age">Your Age (Years)</label> |
| | | <input id="age" name="age" type="number" /> |
| | | <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> |
| | |
| | | data() { |
| | | return { |
| | | userName: '', |
| | | userAge: null, |
| | | } |
| | | }, |
| | | methods: { |
| | | submitForm() { |
| | | console.log('Username: ' + this.userName ); |
| | | 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); |
| | | |
| | | this.userAge = null; |
| | | } |
| | | } |
| | | |
| | | } |