FAQ: Vue Forms - Form Validation

This community-built FAQ covers the “Form Validation” exercise from the lesson “Vue Forms”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Vue.js

FAQs on the exercise Form Validation

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

In this tutorial I’ve noticed a strange way to check for isEmpty:
statements like:

   if (this.firstName && this.lastName)       
                             or
  return this.firstName && this.lastName && this.email &&this.purchaseAgreementSigned;

Are those statements checking for isEmpty?

1 Like

Was going to ask the same thing. I think returning something rather than nothing is also returning an implicit boolean value.

this answer seems to confirm that. An if statement without a conditional statement can be used to check for emptiness.

Similar question, and also wondering why my solution was considered incorrect, I typed:

if (this.firstName && this.lastName this.lastName && this.email && this.purchaseAgreementSigned ){
return true;
};

Does it not ammount to the same thing?

It seems to me that the method with the submitForm function was forgotten in the exercise.
If you don’t see any difference when clicking on the button, check if you have any method for submit
e.g.

submitForm: function(){
      console.log('Form is submitted!')
    }