0

I am doing form validations in vuelidate. I have a date picker in my form which is not a mandatory field. Yet I cannot submit the form without selecting a date from the date picker. How is it so? Can anyone tell me how to fix it? I want to keep the date picker field as not a mandatory field. Here is my code:

<v-menu ref="menu3" :close-on-content-click="false" v-model="anniversaryVisibility" :nudge-right="10" :return-value.sync="enquiryForm.anniversary"
     lazy
     transition="scale-transition"
     offset-y
      full-width
      min-width="290px">

     <v-text-field 
    slot="activator" 
    v-model="enquiryForm.anniversary" 
    label="Anniversary" 
    append-icon="event" 
    outline 
    readonly
    :error-messages="fieldErrors('enquiryForm.anniversary')"
    @input="$v.enquiryForm.anniversary.$touch()"
    @blur="$v.enquiryForm.anniversary.$touch()"
    >
    </v-text-field>

<v-date-picker v-model="enquiryForm.anniversary" @input="$refs.menu3.save(enquiryForm.anniversary)"></v-date-picker>

</v-menu>
Boidurja Talukdar
  • 676
  • 2
  • 21
  • 42

1 Answers1

0

Can I see the stuff inside the <script> tags?

I'm assuming inside you have something like this

  validations: {
    fields: {
      anniversary: required
    }
  }

So you would have set anniversary to required, you just need to delete it.

Samantha
  • 751
  • 2
  • 6
  • 18