This is my code. I'm using stripe code fields
Card number
<label>
<span style="width:151px;">Card Number</span>
<input type="text" size="20" class="field" data-stripe="number" placeholder="4242-4242-4242-4242"/>
</label>
CVC number size 3
<label>
<span style="width:151px;"> CVC</span>
<input type="text" size="3" class="field" data-stripe="cvc" placeholder="CVC"/>
</label>
Month size 2 and year 4
<label>
<span style="width:151px;">Expiration(MM/YYYY)</span>
<input type="text" size="2" class="field" data-stripe="exp-month" placeholder="MM"/>
<input type="text" size="4" class="field" data-stripe="exp-year" placeholder="YY"/>
</label>
Not an exact answer to your question, but if possible, I'd recommend that you switch to using Elements (Stripe.js v3) instead of Stripe.js v2.
Not only will it take care of formatting the card number automatically, it will also make you eligible for PCI SAQ A, while with Stripe.js v2, you'd fall under the more cumbersome PCI SAQ A-EP. (More information about this here .)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.