fix: better validation on Contact form
This commit is contained in:
parent
fdd4589e1e
commit
30a271249c
1 changed files with 43 additions and 30 deletions
|
@ -7,12 +7,20 @@
|
|||
>
|
||||
Ici vous pouvez préciser quelques manières de contacter votre association, aucun des champs indiqués n'est obligatoire.
|
||||
</v-alert>
|
||||
<v-alert
|
||||
v-if="!formValid"
|
||||
dense
|
||||
type="error"
|
||||
>
|
||||
Attention ! Certains des champs renseignés sont invalides !
|
||||
</v-alert>
|
||||
</div>
|
||||
<!-- <v-text-field
|
||||
prepend-icon="call"
|
||||
label="Numéro de téléphone"
|
||||
outlined
|
||||
v-model="$store.state.data.contacts.phone" /> -->
|
||||
<v-form v-model="formValid" ref="form">
|
||||
<v-text-field
|
||||
prepend-icon="public"
|
||||
label="Site web"
|
||||
|
@ -43,6 +51,7 @@
|
|||
outlined
|
||||
v-model="$store.state.data.contacts.instagram"
|
||||
:rules="rules.instagram" />
|
||||
</v-form>
|
||||
<AdditionalContacts />
|
||||
<!-- <v-card
|
||||
v-for="(contact, index) in $store.state.data.contacts.peoples"
|
||||
|
@ -92,7 +101,11 @@ export default {
|
|||
components: {
|
||||
AdditionalContacts
|
||||
},
|
||||
mounted () {
|
||||
this.$refs.form.validate()
|
||||
},
|
||||
data: () => ({
|
||||
formValid: false,
|
||||
rules: {
|
||||
website: [
|
||||
v => v === '' || /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/gm.test(v) || "L'adresse web doit être valide"
|
||||
|
|
Loading…
Reference in a new issue