angular - jasny input mask doesn't allow to pick field values up -
i've created form:
this.cardform = this.fb.group({ card_number: ['', validators.required], holdername: ['', validators.required], expiry: ['', validators.required], cvc: ['', validators.required] });
into template:
<form [formgroup]="cardform" novalidate="novalidate"> <div class="form-group"> <label for="card_number">card number</label> <input type="tel" id="card_number" name="card_number" class="input-transparent form-control" formcontrolname="card_number" placeholder="____-____-____-____" data-mask="9999-9999-9999-9999" data-parsley-creditcard="" required="required"> </div> <div class="form-group"> <label for="holdername">holder name</label> <input type="text" id="holdername" name="holdername" placeholder="holder name" formcontrolname="holdername" class="input-transparent form-control" required="required"> </div> <div class="form-group"> <!-- formgroupname="expiry">--> <label for="expirationmonth">expiration month</label> <input type="tel" id="expiry" name="expiry" class="input-transparent form-control" formcontrolname="expiry" placeholder="__ / __" data-mask="99 / 99" data-parsley-cardexpiry="" required> </div> <div class="form-group"> <label for="cvc">checking verification code</label> <input type="tel" id="cvc" name="cvc" class="input-transparent form-control" formcontrolname="cvc" placeholder="checking verification code (cvc)" data-mask="999" data-parsley-cvv="" required="required"> </div> </form>
as can see i'm setting data-mask
on "card_number"
, "expiry"
, "cvc"
:
"card_number"
:data-mask="9999-9999-9999-9999"
"expiry"
:data-mask="99 / 99"
"cvc"
:data-mask="999"
so, when i'm trying collect form field values, these ones empty ("card_number"
, "expiry"
, "cvc"
). if remove data-mask
attributes picked up.
Comments
Post a Comment