Check date

this function check if the values ​​are correct at the same time to be entering data for a date, ie if for day introduce a higher than 31 value is cleared automatically if month is greater than 12 the value store is erased introduced for the month, if the day entered did not match the month also is erased ie, if you enter 31 and month 02 is erased as it is not a valid date. The function can also be controlled leap year or not. 
note: date format: dd-mm-yyyy. 

(-) Whenever a part of the date is completed, a script is entered automatically as the delimiter character.