I went about this a while ago, and found it just better to validate the date from the box, rather than trying to prevent them from typing it in. It's also a bit more user friendly to let them type it in. If someone wants to see something from 6 months ago, they probably don't want to scroll through a calendar when the have an exact date in mind. Best bet would be to populate the text box with a date(use todays if there's no default), so they have a format which to abide by right in front of them. Then just validate the input upon submittion.
Example: This expects a date format of mm/dd/yyyy
function datecheck($date) {
if(eregi("^[0-1]{1}[0-9]{1}\/[0-3]{1}[0-9]{1}\/[0-9]{4}", $date, $dt)) {
$s = explode("/", $dt[0]);
if(checkdate($s[0], $s[1], $s[2])) {
return true;
}
}
return false;
}