I am trying to figure out how I can do validation on a custom form

I have an order form;

I need to set credit card expiration date as MMYYYY


I have 2 fields 'expire_month' and 'expire_year'

In my layout I manually added 2 select boxes;

<select name="expiry_month">
<option value="01">Jan</option>
...
</select>

<select name="expiry_year">
<option>2011</option>
...
</select>

I need some idea how to validate this input to make sure it is not past the current date and obviously put the appropriate error message under the field like the rest of the errors being display.

Any help would be appreciated.

Thanks.

Reply via email to