Home > front end >  Make Accept Terms and conditions fields required in Laravel
Make Accept Terms and conditions fields required in Laravel

Time:09-18

I have a checkbox in vue.js

<input  v-model="form.accept" name="Accept" type="checkbox" value="false">

i have model defined

 data() {
        return {
            form: new Form({
                accept: false,

now i want to make this field required

 'accept' =>'required|true',

but this is not working

CodePudding user response:

Please change value="true"

<input  v-model="form.accept" name="Accept" type="checkbox" value="true">

And change rules to

'accept' => 'accepted',
  • Related