Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

285
Views
vuelidate error message show up after form submission

I'm using vuelidate for form validation in vuejs3 and composition api.

After submit form, I call validate. If validation passes, the form fields should be emptied and vuelidate should be reset.

I currently do that like so:

const submitForm = () => {
  if (!v$.value.$validate()) {
    console.log(`Error : ${form} `)
    return
  } 
  // there will be an axios post request here:
  console.log(form)
  v$.value.$reset()
  Object.keys(form).forEach(v => form[v] = "")
  
}

For some reason, v$.value.$reset() is called also when the form is invalid (so validation passes even when forms are invalid) and Object.keys(form).forEach(v => form[v] = "") causes validation errors so that when the form is submitted correctly, all error messages show up.

How to clear the form without reloading the page and reset vuelidate only after submission without errors?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!