function formSetDay(type){
var lastday = formSetLastDay($('[name='+type+'1]').val(), $('[name='+type+'2]').val());
var option = '';
for (var i = 1; i <= lastday; i++) {
if (i === $('[name='+type+'3]').val()){
option += '\n';
}else{
option += '\n';
}
}
$('[name='+type+'3]').html(option);
}
function formSetLastDay(year, month){
var lastday = new Array('', 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0){
lastday[2] = 29;
}
return lastday[month];
}
$('.selectYear, .selectMonth').on('change',function(){
formSetDay($(this).data('type'));
});