How to Create a List Box Form for Credit Card Dates With XHTML
XHTML is one of the older markup standards that came before HTML5. Even though it's older, it's still very widely used on the Web. One of the driving forces behind the Internet since the early 1990s has been e-commerce, and the vast majority of e-commerce is driven by credit card sales. A sophisticated technology infrastructure was built to facilitate online credit card transactions, but at a basic level, it's simply a customer entering credit card information and pressing "Buy." One piece of information necessary for a credit card transaction is the expiration date of the card, which is given as a month and a year.
Instructions
-
-
1
Copy and paste the following label for your two expiration date drop-down lists:
<label for="expiration_month">Expires:</label> -
2
Copy and paste the following code into your XHTML form to create a drop-down list for the expiration month:
<label for="expiration_month">Expires:</label>
<select id="expiration_month" name="expiration_month">
<option value="">Choose...</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select> -
-
3
Copy and paste the following code into your XHTML form to create a drop-down list for the expiration year:
<select id="expiration_year" name="expiration_ year">
<option value="">Choose...</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
</select>
-
1
Tips & Warnings
Most credit cards expire within five years of being issued, so five years into the future beginning with the current year should be enough for most uses, instead of the 10 years provided in the steps.
References
- Photo Credit credit card image by jimcox40 from Fotolia.com