My real case is like this : https://codepen.io/positivethinking639/pen/ZEEaOqy?editors=1010
The vue component like this :
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: () => ({
selectedCountry: null,
dataCountry: [
{ name: 'England', id: 1 },
{ name: 'Spain', id: 2 },
{ name: 'Italy', id: 3 },
],
selectedClub: null,
dataClub: [
{ name: 'Chelsea', id: 1 },
{ name: 'Madrid', id: 2 },
{ name: 'Juventus', id: 3 },
],
playerName: null,
playerNameRules: [
// v => !!v || 'Name is required',
v => (v && v.length >= 3) || 'Player name at least 3 characters',
],
countryRules: [
v => !!v || 'Country is required',
],
clubRules: [
v => !!v || 'Club is required',
],
validSearch: false,
}),
methods: {
searchPlayer() {
if (this.$refs.formSearch.validate()) {
console.log('validate form success')
}
else
console.log('validate form failed')
}
}
})
so I want the user to be able to search by player name or the user can also search by country and club
if the user enters the player name and clicks the search button, validation is successful. vice versa if the user enters country and club, then click search, it passes validity
so the user can choose one of them to search. but if the user click the search button without selecting one, it displays validation failed
How can I do it?