jwoods7
11-02-2002, 09:30 PM
I have a variable stored in a page, and when the page loads, I want it to run a function that automatically sets the dropdown box to that value. Why won't either of these simple functions work...perhaps too simple??
Variable is named Dmonth;
Form is named dateselect;
<script>
function setDate(){
document.dateselect.Dmonth.value = Dmonth
}
</script>
or
<script>
function setDate(){
document.dateselect[document.dateselect.Dmonth.selectedIndex].value = Dmonth
}
</script>
Variable is named Dmonth;
Form is named dateselect;
<script>
function setDate(){
document.dateselect.Dmonth.value = Dmonth
}
</script>
or
<script>
function setDate(){
document.dateselect[document.dateselect.Dmonth.selectedIndex].value = Dmonth
}
</script>