simple disabled function on submit send

This commit is contained in:
ogerly 2023-02-01 12:26:52 +01:00
parent 77541aa575
commit d3b24621b2

View File

@ -105,7 +105,7 @@
</b-button> </b-button>
</b-col> </b-col>
<b-col cols="12" md="6" lg="6" class="text-lg-right"> <b-col cols="12" md="6" lg="6" class="text-lg-right">
<b-button block type="submit" variant="gradido"> <b-button block type="submit" variant="gradido" :disabled="disabled">
{{ $t('form.check_now') }} {{ $t('form.check_now') }}
</b-button> </b-button>
</b-col> </b-col>
@ -177,6 +177,17 @@ export default {
}, },
}, },
computed: { computed: {
disabled() {
if (
this.form.email.length > 5 &&
parseInt(this.form.amount) <= parseInt(this.balance) &&
this.form.memo.length > 5 &&
this.form.memo.length <= 255
) {
return false
}
return true
},
isBalanceDisabled() { isBalanceDisabled() {
return this.balance <= 0 ? 'disabled' : false return this.balance <= 0 ? 'disabled' : false
}, },