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

389
Views
How to reset the form validation on a create modal?

I am not sure what I should do here in this case. When I click on + Rule, I call this fn()

showAddRuleModal() {
    this.showAddRule = true

    this.$refs.form.reset()

    //reset form values
    this.ruleName = ''
    this.url = 'https://www.'
    this.urlType = 'Single'

    this.ruleDetails = []

    let ruleDetail = {
        attribute_id: '',
        operator_id: '',
        value: ''
    }

    this.ruleDetails.push(ruleDetail)
}

As you can see in the image, I successfully created a rule, and tried to add one more.

enter image description here

As you can see the other values seems to reset but my ruleName input detected as an error even if I reset this.$refs.form.reset()

How can I stop this ?


Note

If I add a space to the default value

this.ruleName = ' '

that error is gone, but now, my form ruleName contains a space. Works, but it's not great.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

after the modal is opened use this:

this.$refs.form.resetValidation()

this should reset the validation. documentation example

about 4 years ago · Juan Pablo Isaza Report
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!