country validation #33k7mh5
This commit is contained in:
parent
2001aaad78
commit
76dea1b1da
17
resources/assets/js/views/common/companies.js
vendored
17
resources/assets/js/views/common/companies.js
vendored
@ -30,5 +30,22 @@ const app = new Vue({
|
||||
form: new Form('company'),
|
||||
bulk_action: new BulkAction('companies')
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// Form Submit
|
||||
onSubmit() {
|
||||
this.form.loading = true;
|
||||
|
||||
if (this.form.country === "") {
|
||||
this.form.errors.set('country', [country_validation_required_message]);
|
||||
|
||||
this.form.loading = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.form.submit();
|
||||
},
|
||||
}
|
||||
});
|
||||
|
@ -65,5 +65,11 @@
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_end')
|
||||
<script type="text/javascript">
|
||||
var country_validation_required_message = "{{ trans('validation.required', ['attribute' => trans_choice('general.countries', 1)]) }}";
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
<x-script folder="common" file="companies" />
|
||||
</x-layouts.admin>
|
||||
|
@ -69,5 +69,11 @@
|
||||
</x-form.container>
|
||||
</x-slot>
|
||||
|
||||
@push('scripts_end')
|
||||
<script type="text/javascript">
|
||||
var country_validation_required_message = "{{ trans('validation.required', ['attribute' => trans_choice('general.countries', 1)]) }}";
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
<x-script folder="common" file="companies" />
|
||||
</x-layouts.admin>
|
||||
|
Loading…
x
Reference in New Issue
Block a user