how to form validate in jscript my card expiry (month and year) using a date object.
how to form validate in jscript my card expiry (month and year) using a date object.
Expiry Date (Month) |
Required field |
Expiry Date |
Valid expiry date to ensure the card being used has not expired |
this is the html code to refer for the id attribute. please no prompt message
<label for="month">Expiry Date</label>
<select id="month" name="month">
<option>- Month -</option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select id="year" name="year">
</select>
<p class="cardError error" id="month_error">* You must choose a month</p>
<p class="cardError error" id="expiry_error">* Invalid expiry date</p>
</li>
Step by step
Solved in 3 steps with 3 images