country validation #33k7mh5
This commit is contained in:
		
							
								
								
									
										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'),
 | 
					            form: new Form('company'),
 | 
				
			||||||
            bulk_action: new BulkAction('companies')
 | 
					            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-form.container>
 | 
				
			||||||
    </x-slot>
 | 
					    </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-script folder="common" file="companies" />
 | 
				
			||||||
</x-layouts.admin>
 | 
					</x-layouts.admin>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,5 +69,11 @@
 | 
				
			|||||||
        </x-form.container>
 | 
					        </x-form.container>
 | 
				
			||||||
    </x-slot>
 | 
					    </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-script folder="common" file="companies" />
 | 
				
			||||||
</x-layouts.admin>
 | 
					</x-layouts.admin>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user