Originally published at: http://www.sitepoint.com/building-credit-card-form-custom-element-polymer/
In this article, we’ll be creating a custom element for a credit card payment form using the Polymer library. The final form is going to look something like this,
The markup that defines this payment form is as trivial as this:
<credit -card amount="$300"></credit>
Predictably, there is an additional layer of abstraction hidden beneath the face of this custom element that takes care of all the complexities accompanying a typical credit card payment form. Using a custom element helps in isolating any potential future problems and keeps the top layer of markup clean and semantic.
Our credit card payment form will be composed of:
- An email address
- A credit card number
- An expiry date
- A CVC number
If you have never used the Polymer library before or need to brush up on your knowledge on the basic concepts of web components, then you can first read my previous articles on SitPoint:
- An Introduction to Web Components and Polymer (Tutorial)
- Building a Pull-Quote Custom Element with Polymer
These articles should bring you up to speed with the minimal knowledge required to understand this article.
Continue reading this article on SitePoint