Padrill
04-24-2003, 05:48 AM
I'm trying to dynamically create a drop down menu for date input using the following function:
<head>
<script language="JavaScript1.2">
function dropDownDay(strName) {
document.write('<select name="' + strName + '">');
for (i=1; i<=31; i++) {
document.write('<option value="' + i +'">' + i + '</option>');
}
document.write('</select>');
return true;
}
</script>
</head>
I call this function using:
<body>
<form name="birthdateForm">
<script language="JavaScript1.2">
dropDownDay(birthDay);
</script>
</form>
</body>
Can I do that and still be able to access the value of the selectedIndex?
document.birthdateForm.birthDay doesn't seem to exist.
Does anyone have any suggestions? Thanx.
<head>
<script language="JavaScript1.2">
function dropDownDay(strName) {
document.write('<select name="' + strName + '">');
for (i=1; i<=31; i++) {
document.write('<option value="' + i +'">' + i + '</option>');
}
document.write('</select>');
return true;
}
</script>
</head>
I call this function using:
<body>
<form name="birthdateForm">
<script language="JavaScript1.2">
dropDownDay(birthDay);
</script>
</form>
</body>
Can I do that and still be able to access the value of the selectedIndex?
document.birthdateForm.birthDay doesn't seem to exist.
Does anyone have any suggestions? Thanx.