validate date format MM/YYYY
help please, i have this script and i want to validate the field <input type="text" id="expirationDate" placeholder="expiration">
the problem is in month value when i put an expired month it will be validated like (02/2016) :'((
any suggestion plz and thx in advance...
function validateExp(expirationDate)
{
if(!$("#expirationDate").val().match(/(0[1-9]|1[012])[\/]((201)[6-9]|(202)[0-9])/) || $("#expirationDate").val()==null || $("#expirationDate").val()=="")
{
var div =$("#expirationDate").closest("div");
div.addClass("has-error");
}
else
{
var div =$("#expirationDate").closest("div");
div.removeClass("has-error");
}
}