function validate()
{
var e = document.getElementById("dd_date");
var dd = e.options[e.selectedIndex].value;
var d = document.getElementById("dd_month");
var mm = d.options[d.selectedIndex].value;
var i = document.getElementById("dd_year");
var yy = i.options[i.selectedIndex].value;
var cal=dd+"-"+mm+"-"+yy;
alert("The DOB is"+cal);
}
document.write("dd:");
document.write("<select id=dd_date >");
var date;
for(date=1;date<=31;date++){
document.write("<option>" + date + "</option>");
}
document.write("");
document.write("month:");
document.write("<select id=dd_month>");
var month;
for(month=1;month<=12;month++){
document.write("<option>" + month + "</option>");
}
document.write("");
document.write("year:");
document.write("<select id=dd_year>");
var year;
for(year=1980;year<=2009;year++){
document.write("<option>" + year + "</option>");
}
document.write("");
</script>
<body>
<form name=form1 action="" method="post">
<input type="submit" value="Submit" onClick="validate();">