I think scripted additions ignore the maxLength value. Change the onchange handler to use a function to make it tidier and chnage it to:
Code:
<select onchange="showInTextbox(this.options[this.selectedIndex].value);" ...>
function showInTextBox(Text)
{
var oText = document.form.birthday;
var sText = oText.value + Text;
var sNewText = sText.substr(sText.length - oText.maxLength);
oText.value = sNewText;
//or as stated below:
//document.form.birthday.value = Text;
}
I'm not sure why your code actually works at all as the text box is named "birthday<k>", whatever the server side value of k is.
And if your date is in the format "dd/mm/yyyy" and you want to limit the length to 10 why not just overwrite the old value everytime, why append to what's there already?
--
Joe (
Microsoft MVP - XML)