add highlight for bad card/cvv/mmyy number in.

This commit is contained in:
Henry Oswald 2018-04-16 10:26:39 +01:00
parent 903a9db936
commit 06fb31533f
2 changed files with 3 additions and 6 deletions

View file

@ -19,7 +19,7 @@ block content
.page-header .page-header
.row .row
.col-xs-9 .col-xs-9
h2 {{planName}} h2 {{planName}} {{validation.errorFields}} {{validation.errorFields.number}}
.col-xs-3 .col-xs-3
div.dropdown.changePlanButton.pull-right(ng-cloak, dropdown) div.dropdown.changePlanButton.pull-right(ng-cloak, dropdown)
a.btn.btn-default.dropdown-toggle( a.btn.btn-default.dropdown-toggle(
@ -102,13 +102,12 @@ block content
required required
) )
.form-group() .form-group(ng-class="validation.errorFields.number ? 'has-error' : ''")
label(for="card-no") #{translate("credit_card_number")} label(for="card-no") #{translate("credit_card_number")}
div#card-no( div#card-no(
type="text" type="text"
name="ccNumber" name="ccNumber"
data-recurly='number' data-recurly='number'
ng-focus="validation.correctCardNumber = true; validation.errorFields.number = false;"
ng-blur="validateCardNumber();" ng-blur="validateCardNumber();"
required required
) )
@ -120,7 +119,6 @@ block content
div( div(
type="number" type="number"
name="month" name="month"
ng-focus="validation.correctExpiry = true; validation.errorFields.expiry = false;"
ng-blur="updateExpiry(); validateExpiry()" ng-blur="updateExpiry(); validateExpiry()"
data-recurly="month" data-recurly="month"
required required
@ -132,7 +130,6 @@ block content
type="number" type="number"
name="year" name="year"
data-recurly="year" data-recurly="year"
ng-focus="validation.correctExpiry = true; validation.errorFields.expiry = false;"
ng-blur="updateExpiry(); validateExpiry()" ng-blur="updateExpiry(); validateExpiry()"
required required
) )
@ -143,7 +140,6 @@ block content
div( div(
type="number" type="number"
ng-model="data.cvv" ng-model="data.cvv"
ng-focus="validation.correctCvv = true; validation.errorFields.cvv = false;"
ng-blur="validateCvv()" ng-blur="validateCvv()"
data-recurly="cvv" data-recurly="cvv"
name="cvv" name="cvv"

View file

@ -311,6 +311,7 @@ input[type="checkbox"],
} }
.has-error { .has-error {
.form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg); .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
color:@red;
} }
.form-control.ng-dirty.ng-invalid:not(:focus) { .form-control.ng-dirty.ng-invalid:not(:focus) {