Forum Moderators: open
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>date input test</title>
<style type="text/css">
input {
width: 2em;
text-align: center;
border: 0;
vertical-alin: top;
font-size: 10pt;
line-height: 12pt;
font-weight: normal;
color: gray;
}
input[name="y"] {
width: 4em;
}
fieldset {
padding: 0 5px 5px;
font-weight: bold;
font-size: 16pt;
line-height: 16pt;
}
legend {
font-size: 12pt;
font-weight: normal;
}
</style>
</head>
<body>
<form action="#" method="get">
<fieldset>
<legend>Date:</legend>
<input type="text" name="d" value="DD" maxlength="2" /> /
<input type="text" name="m" value="MM" maxlength="2" /> /
<input type="text" name="y" value="YYYY" maxlength="4" />
</fieldset>
</form>
</body>
</html>
Tested in FF, safari and opera (all latest versions), did not bother with IE.
IE6 won't support the "input[name="y"]" selector, IE7.js can fix that or you might add some superfluous code to work around it as well.